Giter Site home page Giter Site logo

yorickdewid / postgresql-iban Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 3.0 65 KB

PostgreSQL IBAN extension that can verify International Bank Account Numbers

License: GNU General Public License v3.0

Makefile 1.70% C++ 93.81% Shell 4.49%
iban iban-validator postgresql postgresql-iban postgresql-extension

postgresql-iban's Introduction

C/C++ CI

PostgreSQL IBAN

PostgreSQL IBAN extension that can verify International Bank Account Numbers. This ensures that only valid bank account numbers are stored.

Example

CREATE TABLE test_iban (
  name text,
  account iban
);

--
-- Insert data
--

-- Dutch IBAN format
INSERT INTO test_iban (name, account) VALUES ('John', 'NL91ABNA0417164300');
-- German IBAN format
INSERT INTO test_iban (name, account) VALUES ('Doe', 'DE89370400440532013000');

-- Invalid data
INSERT INTO test_iban (name, account) VALUES ('Dean', 'AZ22NABZ00000000137010001944');

--
-- Show output
--

SELECT * FROM test_iban;

Manually test input

SELECT iban_validate('KW81CBKU0000000000001234560101');
-- Or cast
SELECT 'KZ86125KZT5004100100'::iban;

the ::iban datatype can be cast to an text to perform string operations

SELECT 'KZ86125KZT5004100100'::iban::text;

Build

Make sure PostgreSQL development tools are installed (check pg_config).

On Debian based systems:

sudo apt install postgresql-server-dev-all
git clone https://github.com/yorickdewid/PostgreSQL-IBAN
cd PostgreSQL-IBAN
sudo make install

Login to the database and load the extension

CREATE EXTENSION iban;

postgresql-iban's People

Contributors

tkemperman avatar yorickdewid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

postgresql-iban's Issues

Licence?

Hi,

Could you add a license file to mark the license under which this extension is released?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.