Skip to content

Commit

Permalink
Merge pull request #27 from eeeebbbbrrrr/pgrx-v0.8.4-upgrade
Browse files Browse the repository at this point in the history
upgrade to latest pgrx (v0.8.4)
  • Loading branch information
olirice committed May 25, 2023
2 parents caeab60 + 14d1f46 commit 45c8371
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .ci/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ services:
USER: postgres
command:
- cargo
- pgx
- pgrx
- test
- pg14
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- pg_jsonschema
package_name:
- pg-jsonschema
pgx_version:
- 0.7.1
pgrx_version:
- 0.8.4
postgres: [14, 15]
box:
- { runner: ubuntu-20.04, arch: amd64 }
Expand Down Expand Up @@ -75,12 +75,12 @@ jobs:
# Ensure cargo/rust on path
source "$HOME/.cargo/env"
cargo install cargo-pgx --version ${{ matrix.pgx_version }} --locked
cargo pgx init --pg${{ matrix.postgres }}=/usr/lib/postgresql/${{ matrix.postgres }}/bin/pg_config
cargo install cargo-pgrx --version ${{ matrix.pgrx_version }} --locked
cargo pgrx init --pg${{ matrix.postgres }}=/usr/lib/postgresql/${{ matrix.postgres }}/bin/pg_config
# selects the pgVer from pg_config on path
# https://github.com/tcdi/pgx/issues/288
cargo pgx package --no-default-features --features pg${{ matrix.postgres }}
# https://github.com/tcdi/pgrx/issues/288
cargo pgrx package --no-default-features --features pg${{ matrix.postgres }}
# Create installable package
mkdir archive
Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ crate-type = ["cdylib"]

[features]
default = ["pg15"]
pg12 = ["pgx/pg12", "pgx-tests/pg12" ]
pg13 = ["pgx/pg13", "pgx-tests/pg13" ]
pg14 = ["pgx/pg14", "pgx-tests/pg14" ]
pg15 = ["pgx/pg15", "pgx-tests/pg15" ]
pg12 = ["pgrx/pg12", "pgrx-tests/pg12" ]
pg13 = ["pgrx/pg13", "pgrx-tests/pg13" ]
pg14 = ["pgrx/pg14", "pgrx-tests/pg14" ]
pg15 = ["pgrx/pg15", "pgrx-tests/pg15" ]
pg_test = []

[dependencies]
pgx = "0.7.1"
pgrx = "0.8.4"
serde = "1.0"
serde_json = "1.0"
jsonschema = {version = "0.16.0", default-features = false, features = []}

[dev-dependencies]
pgx-tests = "0.7.1"
pgrx-tests = "0.8.4"

[profile.dev]
panic = "unwind"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ Spin up Postgres with pg_jsonschema installed in a docker container via `docker-


Requires:
- [pgx](https://github.com/tcdi/pgx)
- [pgrx](https://github.com/tcdi/pgrx)


```shell
cargo pgx run
cargo pgrx run
```

which drops into a psql prompt.
Expand All @@ -110,7 +110,7 @@ pg_jsonschema=# select json_matches_schema('{"type": "object"}', '{}');
(1 row)
```

for more complete installation guidelines see the [pgx](https://github.com/tcdi/pgx) docs.
for more complete installation guidelines see the [pgrx](https://github.com/tcdi/pgrx) docs.


## Prior Art
Expand All @@ -119,7 +119,7 @@ for more complete installation guidelines see the [pgx](https://github.com/tcdi/

[is_jsonb_valid](https://github.com/furstenheim/is_jsonb_valid) - JSON Schema Postgres extension written in C

[pgx_json_schema](https://github.com/jefbarn/pgx_json_schema) - JSON Schema Postgres extension written with pgx + jsonschema
[pgx_json_schema](https://github.com/jefbarn/pgx_json_schema) - JSON Schema Postgres extension written with pgrx + jsonschema


## Benchmark
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ RUN \
cargo --version

# PGX
RUN cargo install cargo-pgx --version 0.7.1 --locked
RUN cargo install cargo-pgrx --version 0.8.4 --locked

RUN cargo pgx init --pg14 $(which pg_config)
RUN cargo pgrx init --pg14 $(which pg_config)

USER root

COPY . .
RUN cargo pgx install
RUN cargo pgrx install

RUN chown -R postgres:postgres /home/supa
RUN chown -R postgres:postgres /usr/share/postgresql/14/extension
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pgx::*;
use pgrx::*;

pg_module_magic!();

Expand All @@ -15,7 +15,7 @@ fn jsonb_matches_schema(schema: Json, instance: JsonB) -> bool {
#[pg_schema]
#[cfg(any(test, feature = "pg_test"))]
mod tests {
use pgx::*;
use pgrx::*;
use serde_json::json;

#[pg_test]
Expand Down

0 comments on commit 45c8371

Please sign in to comment.