docs: Update README.md

This commit is contained in:
Ben Merritt 2017-07-06 09:23:32 -07:00
parent a64ad9495d
commit f84f7bb4b8
1 changed files with 26 additions and 20 deletions

View File

@ -5,36 +5,42 @@ A (partially implemented!) PostgreSQL extension that provides access to
## Project status ## Project status
This extension is in an <strong>alpha</strong> state. It's not complete or This extension is in an **alpha** state. It's not complete or tested enough for
tested enough for critical production deployments, but with a little help, we critical production deployments, but with a little help, we should be able to
should be able to get it there. get it there.
## Synopsis ## Synopsis
CREATE EXTENSION pg_libphonenumber; ```sql
SELECT parse_phone_number('03 7010 1234', 'AU'); CREATE EXTENSION pg_libphonenumber;
SELECT parse_phone_number('2819010011', 'US'); SELECT parse_phone_number('03 7010 1234', 'AU');
SELECT parse_phone_number('2819010011', 'US');
CREATE TABLE foo ( ph phone_number ); CREATE TABLE foo ( ph phone_number );
-- DO NOT RELY ON THIS -- DO NOT RELY ON THIS
-- may not always this work way with implicit cast. -- may not always this work way with implicit cast.
SELECT '2819010011'::phone_number; -- assumes US SELECT '2819010011'::phone_number; -- assumes US
```
## Installation ## Installation
### Debian/Ubuntu ### Debian/Ubuntu
First you need install `libphonenumber-dev` and the corresponding `postgresql-server-dev` package. First you'll need to install `libphonenumber-dev` and the corresponding
`postgresql-server-dev` package.
sudo apt-get install build-essential ```shell-script
sudo apt-get install postgresql-server-dev-9.5 sudo apt-get install build-essential
sudo apt-get install libphonenumber-dev sudo apt-get install postgresql-server-dev-9.5
sudo apt-get install libphonenumber-dev
```
Then clone this repostiroy Then clone this repository and build.
cd /tmp ```shell-script
git clone https://github.com/blm768/pg-libphonenumber git clone https://github.com/blm768/pg-libphonenumber
cd pg-libphonenumber cd pg-libphonenumber
make make
sudo make install sudo make install
```