From 0aced598ca7843639ef4a6d20283ac7d140b3274 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Wed, 2 Mar 2022 07:53:50 -0800 Subject: [PATCH] Unify workspace (#456) * Unify workspace Signed-off-by: Ana Hobden * Add bgworker to workspace members Signed-off-by: Ana Hobden * Use resolver 2 Signed-off-by: Ana Hobden * remove extra control file Signed-off-by: Ana Hobden * Update template editions Signed-off-by: Ana Hobden * Use second resolver Signed-off-by: Ana Hobden * The test all CI does not require pg_test as a feature Signed-off-by: Ana Hobden --- .github/workflows/test.yml | 2 +- Cargo.lock | 195 +++++++++++++++++- Cargo.toml | 37 +--- cargo-pgx/Cargo.toml | 2 +- cargo-pgx/src/templates/cargo_toml | 2 +- nix/templates/default/Cargo.toml | 2 +- pgx-examples/aggregate/Cargo.toml | 5 +- pgx-examples/arrays/Cargo.toml | 5 +- pgx-examples/bad_ideas/Cargo.toml | 5 +- pgx-examples/bgworker/Cargo.toml | 5 +- pgx-examples/bytea/Cargo.toml | 5 +- pgx-examples/custom_sql/Cargo.toml | 5 +- pgx-examples/custom_types/Cargo.toml | 5 +- pgx-examples/errors/Cargo.toml | 5 +- pgx-examples/nostd/Cargo.toml | 5 +- pgx-examples/operators/Cargo.toml | 5 +- pgx-examples/schemas/Cargo.toml | 5 +- pgx-examples/shmem/Cargo.toml | 5 +- pgx-examples/spi/Cargo.toml | 5 +- pgx-examples/srf/Cargo.toml | 5 +- pgx-examples/strings/Cargo.toml | 5 +- pgx-examples/triggers/Cargo.toml | 4 +- pgx-macros/Cargo.toml | 2 +- pgx-pg-sys/Cargo.toml | 2 +- pgx-tests/Cargo.toml | 2 +- pgx-utils/Cargo.toml | 2 +- .../aggregate/aggregate_type.rs | 2 +- .../aggregate/maybe_variadic_type.rs | 2 +- .../src/sql_entity_graph/aggregate/mod.rs | 30 +-- .../sql_entity_graph/pg_extern/argument.rs | 2 +- .../src/sql_entity_graph/pg_extern/mod.rs | 6 +- .../sql_entity_graph/pg_extern/operator.rs | 10 +- .../sql_entity_graph/pg_extern/returning.rs | 2 +- pgx/Cargo.toml | 2 +- pgx/src/itemptr.rs | 1 - src/main.rs | 6 - 36 files changed, 238 insertions(+), 152 deletions(-) delete mode 100644 src/main.rs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 70e927e23..8a87b74fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,4 +55,4 @@ jobs: # test our code - name: cargo test - run: RUST_BACKTRACE=1 cargo test --all --features "pg${{ matrix.version }} pg_test" --no-default-features + run: RUST_BACKTRACE=1 cargo test --all --features "pg${{ matrix.version }}" --no-default-features diff --git a/Cargo.lock b/Cargo.lock index 315c69ff6..2209500aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,21 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "aggregate" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -35,6 +50,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "arrays" +version = "0.1.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "arrayvec" version = "0.7.2" @@ -104,6 +128,16 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bad_ideas" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "rand 0.8.5", + "rttp_client", +] + [[package]] name = "bare-metal" version = "0.2.5" @@ -131,6 +165,16 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bgworker" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "rand 0.8.5", + "rttp_client", +] + [[package]] name = "bindgen" version = "0.59.2" @@ -207,6 +251,15 @@ dependencies = [ "glob", ] +[[package]] +name = "bytea" +version = "0.1.0" +dependencies = [ + "libflate", + "pgx", + "pgx-tests", +] + [[package]] name = "byteorder" version = "1.4.3" @@ -525,6 +578,25 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +[[package]] +name = "custom_sql" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + +[[package]] +name = "custom_types" +version = "0.1.0" +dependencies = [ + "maplit", + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "debugid" version = "0.7.3" @@ -624,6 +696,14 @@ dependencies = [ "url", ] +[[package]] +name = "errors" +version = "0.1.0" +dependencies = [ + "pgx", + "pgx-tests", +] + [[package]] name = "eyre" version = "0.6.7" @@ -990,6 +1070,26 @@ version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" +[[package]] +name = "libflate" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d57e534717ac3e0b8dc459fe338bdfb4e29d7eea8fd0926ba649ddd3f4765f" +dependencies = [ + "adler32", + "crc32fast", + "libflate_lz77", +] + +[[package]] +name = "libflate_lz77" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39a734c0493409afcd49deee13c006a04e3586b9761a03543c6272c9c51f2f5a" +dependencies = [ + "rle-decode-fast", +] + [[package]] name = "libloading" version = "0.7.3" @@ -1018,6 +1118,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + [[package]] name = "matchers" version = "0.1.0" @@ -1183,6 +1289,15 @@ dependencies = [ "nom", ] +[[package]] +name = "nostd" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "ntapi" version = "0.3.7" @@ -1268,6 +1383,16 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "operators" +version = "0.1.0" +dependencies = [ + "maplit", + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "os_str_bytes" version = "6.0.0" @@ -1413,17 +1538,6 @@ dependencies = [ "unescape", ] -[[package]] -name = "pgx-parent" -version = "0.3.3" -dependencies = [ - "cargo-pgx", - "pgx", - "pgx-macros", - "pgx-pg-sys", - "pgx-tests", -] - [[package]] name = "pgx-pg-sys" version = "0.3.3" @@ -1827,6 +1941,12 @@ dependencies = [ "regex", ] +[[package]] +name = "rle-decode-fast" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" + [[package]] name = "rttp_client" version = "0.1.0" @@ -1891,6 +2011,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "schemas" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -2073,6 +2202,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" +[[package]] +name = "shmem" +version = "0.1.0" +dependencies = [ + "heapless", + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "shutdown_hooks" version = "0.1.0" @@ -2118,6 +2257,14 @@ dependencies = [ "winapi", ] +[[package]] +name = "spi" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", +] + [[package]] name = "spin" version = "0.9.2" @@ -2127,6 +2274,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "srf" +version = "0.1.0" +dependencies = [ + "pgx", + "pgx-tests", + "rand 0.8.5", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2157,6 +2313,14 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "strings" +version = "0.1.0" +dependencies = [ + "pgx", + "pgx-tests", +] + [[package]] name = "strsim" version = "0.10.0" @@ -2462,6 +2626,15 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "triggers" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-macros", + "pgx-tests", +] + [[package]] name = "typenum" version = "1.15.0" diff --git a/Cargo.toml b/Cargo.toml index 99e11d486..63da78188 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,27 +1,16 @@ -[package] -name = "pgx-parent" -version = "0.3.3" -authors = ["ZomboDB, LLC "] -edition = "2018" -license = "MIT" -description = "Top-level repo for 'pgx' (not on crates.io)" -homepage = "https://github.com/zombodb/pgx/" -repository = "https://github.com/zombodb/pgx/" - [workspace] +resolver = "2" members = [ - ".", "cargo-pgx", "pgx", "pgx-macros", "pgx-pg-sys", "pgx-tests", "pgx-utils", -] -exclude = [ "pgx-examples/aggregate", "pgx-examples/arrays", "pgx-examples/bad_ideas", + "pgx-examples/bgworker", "pgx-examples/bytea", "pgx-examples/custom_types", "pgx-examples/custom_sql", @@ -35,25 +24,3 @@ exclude = [ "pgx-examples/strings", "pgx-examples/triggers", ] - -[features] -default = [ ] -pg10 = [ "pgx/pg10", "pgx-pg-sys/pg10", "pgx-tests/pg10" ] -pg11 = [ "pgx/pg11", "pgx-pg-sys/pg11", "pgx-tests/pg11" ] -pg12 = [ "pgx/pg12", "pgx-pg-sys/pg12", "pgx-tests/pg12" ] -pg13 = [ "pgx/pg13", "pgx-pg-sys/pg13", "pgx-tests/pg13" ] -pg14 = [ "pgx/pg14", "pgx-pg-sys/pg14", "pgx-tests/pg14" ] -pg_test = [ "pgx-tests/pg_test" ] - -[package.metadata.docs.rs] -features = ["pg14"] -no-default-features = true -# Enable `#[cfg(docsrs)]` (https://docs.rs/about/builds#cross-compiling) -rustc-args = ["--cfg", "docsrs"] - -[dependencies] -cargo-pgx = { path = "cargo-pgx", version = "0.3.3" } -pgx = { path = "pgx", version = "0.3.3", default-features = false } -pgx-macros = { path = "pgx-macros", version = "0.3.3" } -pgx-pg-sys = { path = "pgx-pg-sys", version = "0.3.3", default-features = false } -pgx-tests = { path = "pgx-tests", version = "0.3.3", default-features = false } diff --git a/cargo-pgx/Cargo.toml b/cargo-pgx/Cargo.toml index 4f42ebaeb..f5e51df93 100644 --- a/cargo-pgx/Cargo.toml +++ b/cargo-pgx/Cargo.toml @@ -2,7 +2,6 @@ name = "cargo-pgx" version = "0.3.3" authors = ["ZomboDB, LLC "] -edition = "2018" license = "MIT" description = "Cargo subcommand for 'pgx' to make Postgres extension development easy" homepage = "https://github.com/zombodb/pgx" @@ -12,6 +11,7 @@ categories = ["development-tools::cargo-plugins", "command-line-utilities", "dat keywords = ["database", "postgres", "postgresql", "extension"] readme = "README.md" exclude = [ "*.png" ] +edition = "2021" [dependencies] cargo_metadata = "0.14.2" diff --git a/cargo-pgx/src/templates/cargo_toml b/cargo-pgx/src/templates/cargo_toml index 7b3cf351a..0addd7574 100644 --- a/cargo-pgx/src/templates/cargo_toml +++ b/cargo-pgx/src/templates/cargo_toml @@ -1,7 +1,7 @@ [package] name = "{name}" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/nix/templates/default/Cargo.toml b/nix/templates/default/Cargo.toml index 0a9a83565..a17c6dbcb 100644 --- a/nix/templates/default/Cargo.toml +++ b/nix/templates/default/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pgx_demo" version = "0.0.1" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/aggregate/Cargo.toml b/pgx-examples/aggregate/Cargo.toml index 3efab6daf..044f01546 100644 --- a/pgx-examples/aggregate/Cargo.toml +++ b/pgx-examples/aggregate/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "aggregate" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/arrays/Cargo.toml b/pgx-examples/arrays/Cargo.toml index 51b902fa0..bafb27bb0 100644 --- a/pgx-examples/arrays/Cargo.toml +++ b/pgx-examples/arrays/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "arrays" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/bad_ideas/Cargo.toml b/pgx-examples/bad_ideas/Cargo.toml index defaa0ea9..82b9d45e8 100644 --- a/pgx-examples/bad_ideas/Cargo.toml +++ b/pgx-examples/bad_ideas/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "bad_ideas" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/bgworker/Cargo.toml b/pgx-examples/bgworker/Cargo.toml index 337b7ae49..ab25a959d 100644 --- a/pgx-examples/bgworker/Cargo.toml +++ b/pgx-examples/bgworker/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "bgworker" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/bytea/Cargo.toml b/pgx-examples/bytea/Cargo.toml index afc2c6334..c60e596db 100644 --- a/pgx-examples/bytea/Cargo.toml +++ b/pgx-examples/bytea/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "bytea" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/custom_sql/Cargo.toml b/pgx-examples/custom_sql/Cargo.toml index c9c32097d..704609c06 100644 --- a/pgx-examples/custom_sql/Cargo.toml +++ b/pgx-examples/custom_sql/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "custom_sql" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/custom_types/Cargo.toml b/pgx-examples/custom_types/Cargo.toml index 80813d569..9d6ba0710 100644 --- a/pgx-examples/custom_types/Cargo.toml +++ b/pgx-examples/custom_types/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "custom_types" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/errors/Cargo.toml b/pgx-examples/errors/Cargo.toml index 38c4ba242..c79546cee 100644 --- a/pgx-examples/errors/Cargo.toml +++ b/pgx-examples/errors/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "errors" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/nostd/Cargo.toml b/pgx-examples/nostd/Cargo.toml index 7d5446a25..22c65820d 100644 --- a/pgx-examples/nostd/Cargo.toml +++ b/pgx-examples/nostd/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "nostd" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/operators/Cargo.toml b/pgx-examples/operators/Cargo.toml index ca85a700a..8b55df29a 100644 --- a/pgx-examples/operators/Cargo.toml +++ b/pgx-examples/operators/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "operators" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/schemas/Cargo.toml b/pgx-examples/schemas/Cargo.toml index ff50174fa..c71897e7f 100644 --- a/pgx-examples/schemas/Cargo.toml +++ b/pgx-examples/schemas/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "schemas" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/shmem/Cargo.toml b/pgx-examples/shmem/Cargo.toml index 6c1582794..635ab89da 100644 --- a/pgx-examples/shmem/Cargo.toml +++ b/pgx-examples/shmem/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "shmem" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/spi/Cargo.toml b/pgx-examples/spi/Cargo.toml index 377307127..58a340036 100644 --- a/pgx-examples/spi/Cargo.toml +++ b/pgx-examples/spi/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "spi" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/srf/Cargo.toml b/pgx-examples/srf/Cargo.toml index 60f17dbe7..a140db411 100644 --- a/pgx-examples/srf/Cargo.toml +++ b/pgx-examples/srf/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "srf" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/strings/Cargo.toml b/pgx-examples/strings/Cargo.toml index 4eab9046e..74b145e2a 100644 --- a/pgx-examples/strings/Cargo.toml +++ b/pgx-examples/strings/Cargo.toml @@ -1,14 +1,11 @@ [package] name = "strings" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -# remove this empty 'workspace' declaration if compiling outside of 'pgx' -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-examples/triggers/Cargo.toml b/pgx-examples/triggers/Cargo.toml index 0270d0da4..d1e5d39bd 100644 --- a/pgx-examples/triggers/Cargo.toml +++ b/pgx-examples/triggers/Cargo.toml @@ -1,13 +1,11 @@ [package] name = "triggers" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] diff --git a/pgx-macros/Cargo.toml b/pgx-macros/Cargo.toml index 594049bd1..a9a75fa52 100644 --- a/pgx-macros/Cargo.toml +++ b/pgx-macros/Cargo.toml @@ -2,13 +2,13 @@ name = "pgx-macros" version = "0.3.3" authors = ["ZomboDB, LLC "] -edition = "2018" license = "MIT" description = "Proc Macros for 'pgx'" homepage = "https://github.com/zombodb/pgx" repository = "https://github.com/zombodb/pgx" documentation = "https://docs.rs/pgx-macros" readme = "README.md" +edition = "2021" [lib] proc-macro = true diff --git a/pgx-pg-sys/Cargo.toml b/pgx-pg-sys/Cargo.toml index 29ea07d63..c239d6953 100644 --- a/pgx-pg-sys/Cargo.toml +++ b/pgx-pg-sys/Cargo.toml @@ -2,13 +2,13 @@ name = "pgx-pg-sys" version = "0.3.3" authors = ["ZomboDB, LLC "] -edition = "2018" license = "MIT" description = "Generated Rust bindings for Postgres internals, for use with 'pgx'" homepage = "https://github.com/zombodb/pgx" repository = "https://github.com/zombodb/pgx" documentation = "https://docs.rs/pgx-pg-sys" readme = "README.md" +edition = "2021" [features] default = [ ] diff --git a/pgx-tests/Cargo.toml b/pgx-tests/Cargo.toml index d29f94fbb..f1faa6931 100644 --- a/pgx-tests/Cargo.toml +++ b/pgx-tests/Cargo.toml @@ -2,13 +2,13 @@ name = "pgx-tests" version = "0.3.3" authors = ["ZomboDB, LLC "] -edition = "2018" license = "MIT" description = "Test framework for 'pgx'-based Postgres extensions" homepage = "https://github.com/zombodb/pgx" repository = "https://github.com/zombodb/pgx" documentation = "https://docs.rs/pgx-tests" readme = "README.md" +edition = "2021" [lib] crate-type = [ "cdylib", "lib" ] diff --git a/pgx-utils/Cargo.toml b/pgx-utils/Cargo.toml index 65baaf55e..4783149c5 100644 --- a/pgx-utils/Cargo.toml +++ b/pgx-utils/Cargo.toml @@ -2,13 +2,13 @@ name = "pgx-utils" version = "0.3.3" authors = ["ZomboDB, LLC "] -edition = "2018" license = "MIT" description = "Utility functions for 'pgx'" homepage = "https://github.com/zombodb/pgx" repository = "https://github.com/zombodb/pgx" documentation = "https://docs.rs/pgx-utils" readme = "README.md" +edition = "2021" [dependencies] owo-colors = "3.2.0" diff --git a/pgx-utils/src/sql_entity_graph/aggregate/aggregate_type.rs b/pgx-utils/src/sql_entity_graph/aggregate/aggregate_type.rs index 2028b108b..b26eed6e4 100644 --- a/pgx-utils/src/sql_entity_graph/aggregate/aggregate_type.rs +++ b/pgx-utils/src/sql_entity_graph/aggregate/aggregate_type.rs @@ -86,7 +86,7 @@ impl AggregateType { ty_source: #ty_string, ty_id: core::any::TypeId::of::<#ty>(), full_path: core::any::type_name::<#ty>(), - name: None#( .unwrap_or(Some(#name)) )*, + name: None #( .unwrap_or(Some(#name)) )*, } } } diff --git a/pgx-utils/src/sql_entity_graph/aggregate/maybe_variadic_type.rs b/pgx-utils/src/sql_entity_graph/aggregate/maybe_variadic_type.rs index 8e92c64ff..711913648 100644 --- a/pgx-utils/src/sql_entity_graph/aggregate/maybe_variadic_type.rs +++ b/pgx-utils/src/sql_entity_graph/aggregate/maybe_variadic_type.rs @@ -104,7 +104,7 @@ impl MaybeNamedVariadicType { ty_source: #ty_string, ty_id: core::any::TypeId::of::<#ty>(), full_path: core::any::type_name::<#ty>(), - name: None#( .unwrap_or(Some(#name)) )*, + name: None #( .unwrap_or(Some(#name)) )*, }, variadic: #variadic, } diff --git a/pgx-utils/src/sql_entity_graph/aggregate/mod.rs b/pgx-utils/src/sql_entity_graph/aggregate/mod.rs index 57c344da1..b9b633ce8 100644 --- a/pgx-utils/src/sql_entity_graph/aggregate/mod.rs +++ b/pgx-utils/src/sql_entity_graph/aggregate/mod.rs @@ -626,28 +626,28 @@ impl PgAggregate { ordered_set: #const_ordered_set, ty_id: ::core::any::TypeId::of::<#target_ident>(), args: #type_args_iter, - direct_args: None#( .unwrap_or(Some(#type_order_by_args_iter)) )*, + direct_args: None #( .unwrap_or(Some(#type_order_by_args_iter)) )*, stype: #type_stype, sfunc: stringify!(#fn_state), - combinefunc: None#( .unwrap_or(Some(stringify!(#fn_combine_iter))) )*, - finalfunc: None#( .unwrap_or(Some(stringify!(#fn_finalize_iter))) )*, - finalfunc_modify: None#( .unwrap_or(#const_finalize_modify_iter) )*, - initcond: None#( .unwrap_or(Some(#const_initial_condition_iter)) )*, - serialfunc: None#( .unwrap_or(Some(stringify!(#fn_serial_iter))) )*, - deserialfunc: None#( .unwrap_or(Some(stringify!(#fn_deserial_iter))) )*, - msfunc: None#( .unwrap_or(Some(stringify!(#fn_moving_state_iter))) )*, - minvfunc: None#( .unwrap_or(Some(stringify!(#fn_moving_state_inverse_iter))) )*, - mstype: None#( .unwrap_or(Some(::pgx::utils::sql_entity_graph::AggregateTypeEntity { + combinefunc: None #( .unwrap_or(Some(stringify!(#fn_combine_iter))) )*, + finalfunc: None #( .unwrap_or(Some(stringify!(#fn_finalize_iter))) )*, + finalfunc_modify: None #( .unwrap_or(#const_finalize_modify_iter) )*, + initcond: None #( .unwrap_or(Some(#const_initial_condition_iter)) )*, + serialfunc: None #( .unwrap_or(Some(stringify!(#fn_serial_iter))) )*, + deserialfunc: None #( .unwrap_or(Some(stringify!(#fn_deserial_iter))) )*, + msfunc: None #( .unwrap_or(Some(stringify!(#fn_moving_state_iter))) )*, + minvfunc: None #( .unwrap_or(Some(stringify!(#fn_moving_state_inverse_iter))) )*, + mstype: None #( .unwrap_or(Some(::pgx::utils::sql_entity_graph::AggregateTypeEntity { ty_source: #type_moving_state_string, ty_id: ::core::any::TypeId::of::<#type_moving_state_iter>(), full_path: ::core::any::type_name::<#type_moving_state_iter>(), name: None })) )*, - mfinalfunc: None#( .unwrap_or(Some(stringify!(#fn_moving_finalize_iter))) )*, - mfinalfunc_modify: None#( .unwrap_or(#const_moving_finalize_modify_iter) )*, - minitcond: None#( .unwrap_or(Some(#const_moving_intial_condition_iter)) )*, - sortop: None#( .unwrap_or(Some(#const_sort_operator_iter)) )*, - parallel: None#( .unwrap_or(#const_parallel_iter) )*, + mfinalfunc: None #( .unwrap_or(Some(stringify!(#fn_moving_finalize_iter))) )*, + mfinalfunc_modify: None #( .unwrap_or(#const_moving_finalize_modify_iter) )*, + minitcond: None #( .unwrap_or(Some(#const_moving_intial_condition_iter)) )*, + sortop: None #( .unwrap_or(Some(#const_sort_operator_iter)) )*, + parallel: None #( .unwrap_or(#const_parallel_iter) )*, hypothetical: #hypothetical, to_sql_config: #to_sql_config, }; diff --git a/pgx-utils/src/sql_entity_graph/pg_extern/argument.rs b/pgx-utils/src/sql_entity_graph/pg_extern/argument.rs index 64284bb31..8c7a4f751 100644 --- a/pgx-utils/src/sql_entity_graph/pg_extern/argument.rs +++ b/pgx-utils/src/sql_entity_graph/pg_extern/argument.rs @@ -320,7 +320,7 @@ impl ToTokens for PgExternArgument { }, is_optional: #found_optional, is_variadic: #found_variadic, - default: None#( .unwrap_or(Some(#default)) )*, + default: None #( .unwrap_or(Some(#default)) )*, } }; tokens.append_all(quoted); diff --git a/pgx-utils/src/sql_entity_graph/pg_extern/mod.rs b/pgx-utils/src/sql_entity_graph/pg_extern/mod.rs index a6de30a47..65c8a115e 100644 --- a/pgx-utils/src/sql_entity_graph/pg_extern/mod.rs +++ b/pgx-utils/src/sql_entity_graph/pg_extern/mod.rs @@ -274,16 +274,16 @@ impl ToTokens for PgExtern { let submission = ::pgx::utils::sql_entity_graph::PgExternEntity { name: #name, unaliased_name: stringify!(#ident), - schema: None#( .unwrap_or(Some(#schema_iter)) )*, + schema: None #( .unwrap_or(Some(#schema_iter)) )*, file: file!(), line: line!(), module_path: core::module_path!(), full_path: concat!(core::module_path!(), "::", stringify!(#ident)), extern_attrs: vec![#extern_attrs], - search_path: None#( .unwrap_or(Some(vec![#search_path])) )*, + search_path: None #( .unwrap_or(Some(vec![#search_path])) )*, fn_args: vec![#(#inputs),*], fn_return: #returns, - operator: None#( .unwrap_or(Some(#operator)) )*, + operator: None #( .unwrap_or(Some(#operator)) )*, to_sql_config: #to_sql_config, }; ::pgx::utils::sql_entity_graph::SqlGraphEntity::Function(submission) diff --git a/pgx-utils/src/sql_entity_graph/pg_extern/operator.rs b/pgx-utils/src/sql_entity_graph/pg_extern/operator.rs index d589fbd78..a4e71f6ad 100644 --- a/pgx-utils/src/sql_entity_graph/pg_extern/operator.rs +++ b/pgx-utils/src/sql_entity_graph/pg_extern/operator.rs @@ -28,11 +28,11 @@ impl ToTokens for PgOperator { let merges = self.merges; let quoted = quote! { ::pgx::utils::sql_entity_graph::PgOperatorEntity { - opname: None#( .unwrap_or(Some(#opname)) )*, - commutator: None#( .unwrap_or(Some(#commutator)) )*, - negator: None#( .unwrap_or(Some(#negator)) )*, - restrict: None#( .unwrap_or(Some(#restrict)) )*, - join: None#( .unwrap_or(Some(#join)) )*, + opname: None #( .unwrap_or(Some(#opname)) )*, + commutator: None #( .unwrap_or(Some(#commutator)) )*, + negator: None #( .unwrap_or(Some(#negator)) )*, + restrict: None #( .unwrap_or(Some(#restrict)) )*, + join: None #( .unwrap_or(Some(#join)) )*, hashes: #hashes, merges: #merges, } diff --git a/pgx-utils/src/sql_entity_graph/pg_extern/returning.rs b/pgx-utils/src/sql_entity_graph/pg_extern/returning.rs index c7401d2b6..8587fdde9 100644 --- a/pgx-utils/src/sql_entity_graph/pg_extern/returning.rs +++ b/pgx-utils/src/sql_entity_graph/pg_extern/returning.rs @@ -249,7 +249,7 @@ impl ToTokens for Returning { let _ = path_items.pop(); // Drop the one we don't want. path_items.join("::") }, - None#( .unwrap_or(Some(stringify!(#name_iter))) )*, + None #( .unwrap_or(Some(stringify!(#name_iter))) )*, ) } }) diff --git a/pgx/Cargo.toml b/pgx/Cargo.toml index 0821434a1..348dbc158 100644 --- a/pgx/Cargo.toml +++ b/pgx/Cargo.toml @@ -2,7 +2,6 @@ name = "pgx" version = "0.3.3" authors = ["ZomboDB, LLC "] -edition = "2018" license = "MIT" description = "pgx: A Rust framework for creating Postgres extensions" homepage = "https://github.com/zombodb/pgx" @@ -11,6 +10,7 @@ documentation = "https://docs.rs/pgx" categories = ["database"] keywords = ["database", "postgres", "postgresql", "extension"] readme = "../README.md" +edition = "2021" [lib] crate-type = [ "rlib" ] diff --git a/pgx/src/itemptr.rs b/pgx/src/itemptr.rs index a3b3af7dc..93c4829a0 100644 --- a/pgx/src/itemptr.rs +++ b/pgx/src/itemptr.rs @@ -70,7 +70,6 @@ pub fn item_pointer_set_all( blockno: pg_sys::BlockNumber, offno: pg_sys::OffsetNumber, ) { - use std::convert::TryInto; tid.ip_posid = offno; tid.ip_blkid.bi_hi = (blockno >> 16).try_into().unwrap(); tid.ip_blkid.bi_lo = (blockno & 0xffff).try_into().unwrap(); diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index bd0b1ecd2..000000000 --- a/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2020 ZomboDB, LLC . All rights reserved. Use of this source code is -// governed by the MIT license that can be found in the LICENSE file. - -fn main() { - println!("This is pgx"); -}