Go to file
Ben Merritt e267a9216d
make masking functions only work for integral types
2018-06-16 15:12:31 -07:00
.vscode Update project metadata 2017-12-09 15:42:29 -08:00
docker Move Docker files 2018-02-16 20:22:24 -08:00
expected Added phone_number_country_code function 2017-03-13 21:32:50 +00:00
sql Added phone_number_country_code function 2017-03-13 21:32:50 +00:00
src make masking functions only work for integral types 2018-06-16 15:12:31 -07:00
.dockerignore Update Docker files 2018-02-09 19:21:56 -08:00
.gitignore Reorganized code 2017-03-13 19:04:26 +00:00
LICENSE Added license 2017-02-18 17:50:34 +00:00
META.json Fixed license 2017-03-15 20:02:59 +00:00
Makefile Fix C++ warnings 2017-12-09 15:42:41 -08:00
README.md Update project metadata 2017-12-09 15:42:29 -08:00
pg_libphonenumber.control Reorganized source files 2017-02-18 17:46:11 +00:00
run_tests.sh Move Docker files 2018-02-16 20:22:24 -08:00

README.md

pg_libphonenumber

A (partially implemented!) PostgreSQL extension that provides access to Google's libphonenumber

Project status

This extension is in an alpha state. It's not complete or tested enough for critical production deployments, but with a little help, we should be able to get it there.

Synopsis

CREATE EXTENSION pg_libphonenumber;
SELECT parse_phone_number('03 7010 1234', 'AU');
SELECT parse_phone_number('2819010011', 'US');

CREATE TABLE foo ( ph phone_number );

-- DO NOT RELY ON THIS
-- may not always this work way with implicit cast.
SELECT '2819010011'::phone_number; -- assumes US

Installation

Debian/Ubuntu

First you'll need to install libphonenumber-dev and the corresponding postgresql-server-dev package.

sudo apt-get update && sudo apt-get install \
    build-essential \
    postgresql-server-dev-9.6 \
    libphonenumber-dev

Then clone this repository and build.

git clone https://github.com/blm768/pg-libphonenumber
cd pg-libphonenumber
make
sudo make install

Running tests

For convenience, we provide a Docker image that sets up a test environment.

make docker-image
docker run -it pg_libphonenumber