Skip to content

Commit

Permalink
update to pgx 0.4.0; update dependencies;
Browse files Browse the repository at this point in the history
  • Loading branch information
jefbarn committed Mar 22, 2022
1 parent 3775d3d commit 235af6b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 49 deletions.
19 changes: 3 additions & 16 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Auto-generated by pgx. You may edit this, or delete it to have a new one created.

[target.x86_64-unknown-linux-gnu]
linker = "./.cargo/pgx-linker-script.sh"

[target.aarch64-unknown-linux-gnu]
linker = "./.cargo/pgx-linker-script.sh"

[target.x86_64-apple-darwin]
linker = "./.cargo/pgx-linker-script.sh"

[target.aarch64-apple-darwin]
linker = "./.cargo/pgx-linker-script.sh"

[target.x86_64-unknown-freebsd]
linker = "./.cargo/pgx-linker-script.sh"
[build]
# Postgres symbols won't be available until runtime
rustflags = ["-C", "link-args=-Wl,-undefined,dynamic_lookup"]
19 changes: 0 additions & 19 deletions .cargo/pgx-linker-script.sh

This file was deleted.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "pgx_json_schema"
version = "0.2.1"
version = "0.2.2"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
crate-type = ["cdylib"]

[features]
default = ["pg14"]
Expand All @@ -16,15 +16,15 @@ pg14 = ["pgx/pg14"]
pg_test = []

[dependencies]
pgx = "0.2.6"
pgx-macros = "0.2.6"
serde_json = "1.0.73"
jsonschema = "0.13.3"
pgx = "0.4.0"
pgx-macros = "0.4.0"
serde_json = "1.0.79"
jsonschema = "0.15.0"
jtd = "0.3.1"
avro-rs = "0.13.0"

[dev-dependencies]
pgx-tests = "0.2.6"
pgx-tests = "0.4.0"

[profile.dev]
panic = "unwind"
Expand Down
2 changes: 0 additions & 2 deletions src/bin/sql-generator.rs

This file was deleted.

7 changes: 5 additions & 2 deletions src/json_schema.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use pgx::*;
use jsonschema::JSONSchema;
use pgx::*;

#[pg_extern]
fn json_schema_is_valid(schema: JsonB, instance: JsonB) -> bool {
Expand Down Expand Up @@ -62,6 +62,9 @@ mod tests {
let (_value, description) = Spi::get_two::<JsonB, String>(
"select * from json_schema_get_errors('{\"maxLength\": 5}', '\"foobar\"'::jsonb)",
);
assert_eq!(description, Some("\"foobar\" is longer than 5 characters".to_string()))
assert_eq!(
description,
Some("\"foobar\" is longer than 5 characters".to_string())
)
}
}
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
mod avro;
mod json_schema;
mod json_type_def;
mod avro;


use pgx::*;

pg_module_magic!();


#[cfg(test)]
pub mod pg_test {
pub fn setup(_options: Vec<&str>) {
Expand Down

0 comments on commit 235af6b

Please sign in to comment.