From a683575d4562288903ab735da80e92cc8edf11ea Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Fri, 25 Feb 2022 13:57:53 -0800 Subject: [PATCH 1/7] Unify workspace Signed-off-by: Ana Hobden --- Cargo.lock | 185 +++++++++++++++++++++++++-- Cargo.toml | 35 ----- pgx-examples/aggregate/Cargo.toml | 3 - pgx-examples/arrays/Cargo.toml | 3 - pgx-examples/bad_ideas/Cargo.toml | 3 - pgx-examples/bgworker/Cargo.toml | 3 - pgx-examples/bytea/Cargo.toml | 3 - pgx-examples/custom_sql/Cargo.toml | 3 - pgx-examples/custom_types/Cargo.toml | 3 - pgx-examples/errors/Cargo.toml | 3 - pgx-examples/nostd/Cargo.toml | 3 - pgx-examples/operators/Cargo.toml | 3 - pgx-examples/schemas/Cargo.toml | 3 - pgx-examples/shmem/Cargo.toml | 3 - pgx-examples/spi/Cargo.toml | 3 - pgx-examples/srf/Cargo.toml | 3 - pgx-examples/strings/Cargo.toml | 3 - pgx-examples/triggers/Cargo.toml | 2 - src/main.rs | 6 - 19 files changed, 174 insertions(+), 99 deletions(-) delete mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 0b78cc77c..f9510564b 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 0.3.9", ] +[[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" @@ -211,6 +245,15 @@ dependencies = [ "glob", ] +[[package]] +name = "bytea" +version = "0.1.0" +dependencies = [ + "libflate", + "pgx", + "pgx-tests", +] + [[package]] name = "byteorder" version = "1.4.3" @@ -555,6 +598,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.2" @@ -667,6 +729,14 @@ dependencies = [ "url", ] +[[package]] +name = "errors" +version = "0.1.0" +dependencies = [ + "pgx", + "pgx-tests", +] + [[package]] name = "eyre" version = "0.6.7" @@ -1039,6 +1109,26 @@ version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94" +[[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" @@ -1067,6 +1157,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" @@ -1232,6 +1328,15 @@ dependencies = [ "nom", ] +[[package]] +name = "nostd" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "ntapi" version = "0.3.7" @@ -1317,6 +1422,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" @@ -1439,17 +1554,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" @@ -1853,6 +1957,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" @@ -1917,6 +2027,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "schemas" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", + "serde", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -2093,6 +2212,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" @@ -2139,6 +2268,14 @@ dependencies = [ "ws2_32-sys", ] +[[package]] +name = "spi" +version = "0.0.0" +dependencies = [ + "pgx", + "pgx-tests", +] + [[package]] name = "spin" version = "0.9.2" @@ -2148,6 +2285,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" @@ -2178,6 +2324,14 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "strings" +version = "0.1.0" +dependencies = [ + "pgx", + "pgx-tests", +] + [[package]] name = "strsim" version = "0.8.0" @@ -2497,6 +2651,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..a661eacde 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,11 @@ -[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] members = [ - ".", "cargo-pgx", "pgx", "pgx-macros", "pgx-pg-sys", "pgx-tests", "pgx-utils", -] -exclude = [ "pgx-examples/aggregate", "pgx-examples/arrays", "pgx-examples/bad_ideas", @@ -35,25 +22,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/pgx-examples/aggregate/Cargo.toml b/pgx-examples/aggregate/Cargo.toml index 3efab6daf..59c4112be 100644 --- a/pgx-examples/aggregate/Cargo.toml +++ b/pgx-examples/aggregate/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..204748fc1 100644 --- a/pgx-examples/arrays/Cargo.toml +++ b/pgx-examples/arrays/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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 e5a52749a..a0f6c7240 100644 --- a/pgx-examples/bad_ideas/Cargo.toml +++ b/pgx-examples/bad_ideas/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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 5f13a4b50..1d207c2c4 100644 --- a/pgx-examples/bgworker/Cargo.toml +++ b/pgx-examples/bgworker/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..080aef7ca 100644 --- a/pgx-examples/bytea/Cargo.toml +++ b/pgx-examples/bytea/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..86a6779f8 100644 --- a/pgx-examples/custom_sql/Cargo.toml +++ b/pgx-examples/custom_sql/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..f4b69e236 100644 --- a/pgx-examples/custom_types/Cargo.toml +++ b/pgx-examples/custom_types/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..7c5b88afe 100644 --- a/pgx-examples/errors/Cargo.toml +++ b/pgx-examples/errors/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..9c7855e58 100644 --- a/pgx-examples/nostd/Cargo.toml +++ b/pgx-examples/nostd/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..02ca8f9dd 100644 --- a/pgx-examples/operators/Cargo.toml +++ b/pgx-examples/operators/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..9488e7175 100644 --- a/pgx-examples/schemas/Cargo.toml +++ b/pgx-examples/schemas/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..931ce004f 100644 --- a/pgx-examples/shmem/Cargo.toml +++ b/pgx-examples/shmem/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..356a688aa 100644 --- a/pgx-examples/spi/Cargo.toml +++ b/pgx-examples/spi/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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 8e953b1a3..b0226673b 100644 --- a/pgx-examples/srf/Cargo.toml +++ b/pgx-examples/srf/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..2e1f6e034 100644 --- a/pgx-examples/strings/Cargo.toml +++ b/pgx-examples/strings/Cargo.toml @@ -6,9 +6,6 @@ edition = "2018" [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..d12a28180 100644 --- a/pgx-examples/triggers/Cargo.toml +++ b/pgx-examples/triggers/Cargo.toml @@ -6,8 +6,6 @@ edition = "2018" [lib] crate-type = ["cdylib"] -[workspace] - [features] default = ["pg13"] pg10 = ["pgx/pg10", "pgx-tests/pg10" ] 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"); -} From ac88c754806a17a4ce52882cd37192d7a2afa497 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Fri, 25 Feb 2022 14:10:01 -0800 Subject: [PATCH 2/7] Add bgworker to workspace members Signed-off-by: Ana Hobden --- Cargo.lock | 10 ++++++++++ Cargo.toml | 1 + 2 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index f9510564b..9f0b3566a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,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" diff --git a/Cargo.toml b/Cargo.toml index a661eacde..b07a98e22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "pgx-examples/aggregate", "pgx-examples/arrays", "pgx-examples/bad_ideas", + "pgx-examples/bgworker", "pgx-examples/bytea", "pgx-examples/custom_types", "pgx-examples/custom_sql", From 54c13984e801321a7bf793e896e3ebf1fae77235 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 1 Mar 2022 09:47:13 -0800 Subject: [PATCH 3/7] Use resolver 2 Signed-off-by: Ana Hobden --- cargo-pgx/Cargo.toml | 2 +- pgx-examples/aggregate/Cargo.toml | 2 +- pgx-examples/arrays/Cargo.toml | 2 +- pgx-examples/bad_ideas/Cargo.toml | 2 +- pgx-examples/bgworker/Cargo.toml | 2 +- pgx-examples/bytea/Cargo.toml | 2 +- pgx-examples/custom_sql/Cargo.toml | 2 +- pgx-examples/custom_types/Cargo.toml | 2 +- pgx-examples/errors/Cargo.toml | 2 +- pgx-examples/nostd/Cargo.toml | 2 +- pgx-examples/operators/Cargo.toml | 2 +- pgx-examples/schemas/Cargo.toml | 2 +- pgx-examples/shmem/Cargo.toml | 2 +- pgx-examples/spi/Cargo.toml | 2 +- pgx-examples/srf/Cargo.toml | 2 +- pgx-examples/strings/Cargo.toml | 2 +- pgx-examples/triggers/Cargo.toml | 2 +- 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/pgx.control | 5 ++++ pgx/src/itemptr.rs | 1 - 31 files changed, 54 insertions(+), 50 deletions(-) create mode 100644 pgx/pgx.control 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/pgx-examples/aggregate/Cargo.toml b/pgx-examples/aggregate/Cargo.toml index 59c4112be..044f01546 100644 --- a/pgx-examples/aggregate/Cargo.toml +++ b/pgx-examples/aggregate/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "aggregate" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/arrays/Cargo.toml b/pgx-examples/arrays/Cargo.toml index 204748fc1..bafb27bb0 100644 --- a/pgx-examples/arrays/Cargo.toml +++ b/pgx-examples/arrays/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "arrays" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/bad_ideas/Cargo.toml b/pgx-examples/bad_ideas/Cargo.toml index 4de69007e..82b9d45e8 100644 --- a/pgx-examples/bad_ideas/Cargo.toml +++ b/pgx-examples/bad_ideas/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bad_ideas" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/bgworker/Cargo.toml b/pgx-examples/bgworker/Cargo.toml index 297b17814..ab25a959d 100644 --- a/pgx-examples/bgworker/Cargo.toml +++ b/pgx-examples/bgworker/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bgworker" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/bytea/Cargo.toml b/pgx-examples/bytea/Cargo.toml index 080aef7ca..c60e596db 100644 --- a/pgx-examples/bytea/Cargo.toml +++ b/pgx-examples/bytea/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bytea" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/custom_sql/Cargo.toml b/pgx-examples/custom_sql/Cargo.toml index 86a6779f8..704609c06 100644 --- a/pgx-examples/custom_sql/Cargo.toml +++ b/pgx-examples/custom_sql/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "custom_sql" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/custom_types/Cargo.toml b/pgx-examples/custom_types/Cargo.toml index f4b69e236..9d6ba0710 100644 --- a/pgx-examples/custom_types/Cargo.toml +++ b/pgx-examples/custom_types/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "custom_types" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/errors/Cargo.toml b/pgx-examples/errors/Cargo.toml index 7c5b88afe..c79546cee 100644 --- a/pgx-examples/errors/Cargo.toml +++ b/pgx-examples/errors/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "errors" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/nostd/Cargo.toml b/pgx-examples/nostd/Cargo.toml index 9c7855e58..22c65820d 100644 --- a/pgx-examples/nostd/Cargo.toml +++ b/pgx-examples/nostd/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "nostd" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/operators/Cargo.toml b/pgx-examples/operators/Cargo.toml index 02ca8f9dd..8b55df29a 100644 --- a/pgx-examples/operators/Cargo.toml +++ b/pgx-examples/operators/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "operators" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/schemas/Cargo.toml b/pgx-examples/schemas/Cargo.toml index 9488e7175..c71897e7f 100644 --- a/pgx-examples/schemas/Cargo.toml +++ b/pgx-examples/schemas/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "schemas" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/shmem/Cargo.toml b/pgx-examples/shmem/Cargo.toml index 931ce004f..635ab89da 100644 --- a/pgx-examples/shmem/Cargo.toml +++ b/pgx-examples/shmem/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "shmem" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/spi/Cargo.toml b/pgx-examples/spi/Cargo.toml index 356a688aa..58a340036 100644 --- a/pgx-examples/spi/Cargo.toml +++ b/pgx-examples/spi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "spi" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/srf/Cargo.toml b/pgx-examples/srf/Cargo.toml index 96a79fe4d..a140db411 100644 --- a/pgx-examples/srf/Cargo.toml +++ b/pgx-examples/srf/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "srf" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/strings/Cargo.toml b/pgx-examples/strings/Cargo.toml index 2e1f6e034..74b145e2a 100644 --- a/pgx-examples/strings/Cargo.toml +++ b/pgx-examples/strings/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "strings" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] diff --git a/pgx-examples/triggers/Cargo.toml b/pgx-examples/triggers/Cargo.toml index d12a28180..d1e5d39bd 100644 --- a/pgx-examples/triggers/Cargo.toml +++ b/pgx-examples/triggers/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "triggers" version = "0.0.0" -edition = "2018" +edition = "2021" [lib] crate-type = ["cdylib"] 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/pgx.control b/pgx/pgx.control new file mode 100644 index 000000000..7538c5d3b --- /dev/null +++ b/pgx/pgx.control @@ -0,0 +1,5 @@ +comment = 'pgx: Created by pgx' +default_version = '1.0' +module_pathname = '$libdir/pgx' +relocatable = false +superuser = false 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(); From 7c66b9e60fe5a18f90ee513c8e16cf96b58eea20 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 1 Mar 2022 09:51:10 -0800 Subject: [PATCH 4/7] remove extra control file Signed-off-by: Ana Hobden --- pgx/pgx.control | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 pgx/pgx.control diff --git a/pgx/pgx.control b/pgx/pgx.control deleted file mode 100644 index 7538c5d3b..000000000 --- a/pgx/pgx.control +++ /dev/null @@ -1,5 +0,0 @@ -comment = 'pgx: Created by pgx' -default_version = '1.0' -module_pathname = '$libdir/pgx' -relocatable = false -superuser = false From 9b9f59e63da67cc09ef8d429c51de919df7b2894 Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 1 Mar 2022 09:59:40 -0800 Subject: [PATCH 5/7] Update template editions Signed-off-by: Ana Hobden --- cargo-pgx/src/templates/cargo_toml | 2 +- nix/templates/default/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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"] From f28025c5a341ca61e80917a5ec2021eed3bc17ed Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 1 Mar 2022 10:34:00 -0800 Subject: [PATCH 6/7] Use second resolver Signed-off-by: Ana Hobden --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index b07a98e22..63da78188 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "cargo-pgx", "pgx", From 65913c8bc20276a94855ec08c7dfc7647b094a5d Mon Sep 17 00:00:00 2001 From: Ana Hobden Date: Tue, 1 Mar 2022 11:32:30 -0800 Subject: [PATCH 7/7] The test all CI does not require pg_test as a feature Signed-off-by: Ana Hobden --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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