Skip to content

Commit

Permalink
README edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jefbarn committed Jul 27, 2021
1 parent 94cb3d6 commit 694bddd
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,27 @@ This repo is a lightweight connection between the following excellent packages:

### Installation:

1. [Install Rust](https://www.rust-lang.org/tools/install)

`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`


2. Install [PGX](https://github.com/zombodb/pgx)

`cargo install cargo-pgx`


3. Download this repo

`curl -L 'https://github.com/jefbarn/pgx_json_schema/archive/refs/tags/0.1.0.tar.gz' | tar -xz --strip-components=1`
```shell
# [Install Rust](https://www.rust-lang.org/tools/install)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install PGX
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

4. Build and install the extension package
# Download this repo
curl -L 'https://github.com/jefbarn/pgx_json_schema/archive/refs/tags/0.1.0.tar.gz' \
| tar -xz --strip-components=1

`cargo pgx package`
# Build and install the extension package
cargo pgx package

# Enable the extension in your database
create extension pgx_json_schema;
```

5. Enable the extension in your database

`create extension pgx_json_schema;`
### How to use:

```postgresql
```
select * from json_schema_is_valid('{"maxLength": 5}'::jsonb, '"foobar"'::jsonb);
json_schema_is_valid
Expand All @@ -46,7 +41,7 @@ f
```


```postgresql
```
select * from json_schema_get_errors('{"maxLength": 5}'::jsonb, '"foobar"'::jsonb);
error_value | description | details | instance_path | schema_path
Expand Down

0 comments on commit 694bddd

Please sign in to comment.