-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: 0.2.0-beta.0 #221
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Getting function argument type oids can be surprisingly expensive; one Promscale benchmark measures it as taking over 10% of runtime. Fortunately, most types do not actually make use of this information, and the `getarg_type()` call can be optimized out if this fact is known. This commit adds an opt-in method for declaring that a type does not make use of the `typeoid` in `from_datum()`, and updates `pg_getarg()` to make use of this information. This commit makes the following changes: 1. It adds a `const` boolean to `FromDatum` called `NEEDS_TYPID`. This boolean is defaulted to `true`. Types that never use the `typeoid` parameter to `from_datum()` can override this to `false`. 2. `pg_getarg()` updated to look at `T::NEEDS_TYPID` before calling `get_getarg_type()`. If `T::NEEDS_TYPID == true` it calls `get_getarg_type()` like it currently does for all types; if it is `false` it instead passes `InvalidOid` as the (unused) `typeoid` argument to `from_datum()`. 3. It edits a number of built in types to make use of this optimization. Since this feature is both opt-in and backwards compatible, it should not break any downstream users.
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
- for MacOS, the `-exported_symbols_list` doesn't want `=` to set its argument
…ined,dynamic_lookup` bit. We only need this for building the .so.
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Enable new SQL generator on Mac
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Use thin lto in debug to ensure symbols are properly exported.
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
fix: attempt repair docsrs build
chore: reduce UB in public API
Update deps
Signed-off-by: Ana Hobden <[email protected]>
fix: Mark is_a unsafe
* chore: add articles page Signed-off-by: Ana Hobden <[email protected]> * chore: add clarifying 'a' Signed-off-by: Ana Hobden <[email protected]> * chore: add date comment Signed-off-by: Ana Hobden <[email protected]> * chore: add another article! Signed-off-by: Ana Hobden <[email protected]> * chore: add video link Signed-off-by: Ana Hobden <[email protected]> * chore: Update some article contents Signed-off-by: Ana Hobden <[email protected]> * chore: remove TODO link Signed-off-by: Ana Hobden <[email protected]>
* set a number of functions as unsafe, because we can't guarantee the pointers being passed in * fix doctest Co-authored-by: Eric B. Ridge <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Signed-off-by: Ana Hobden <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Features
pgx
SQL generation system has been rewritten! It now uses the proc macro system and has several breaking changes. Please refer to the migration guide below. (Introduce a more robust SQL generator #165, Enable new SQL generator on Mac #197)uuid
type is now supported! (Added support for uuid PostgreSQL type #172)cargo pgx test
now accepts an optional testname.cargo pgx test specific::path
works just likecargo test
! (feat: support testname in cargo pgx test #186)pgx-pg-sys
now suggests you installrustfmt
if you don't have it. (Suggest rustfmt install #193)cargo pgx schema
will now emit informational messages if extensionCargo.toml
settings are not what is expected. (Verify cargo toml settings #209)cargo pgx test
now has a--workspace
argument matching the equivalent oncargo test
. (Don't run all tests in cargo pgx test #169)Other changes
oid
s don't need to be looked up in functions that don't use them. (Don't look up the type oid for types that never use it #168)articles/
directory now exists in the repo and includes links to different articles written aboutpgx
. (Articles #198)Migration Guide
Update your
cargo-pgx
:cargo install --force cargo-pgx --version 0.2.0-beta.0
In your
Cargo.toml
, setcrate-type
to include"rlib"
andprofile.dev.lto
to be"thin"
:Tell
cargo-pgx
to force update your.cargo/
andsrc/bin
files it needs:cargo pgx schema -f
Remove any
sql/*.generated.sql
files, as well as theload-order.txt
.For each
sql/*.sql
remaining, insertextension_sql_file!("../sql/that_file.sql");
into yoursrc/lib.rs
If the files depend on entities which already exist, you might need to set a
requires
attribute:For any
mod floof { fn boop() { todo!() } }
style blocks you were using to infer schema name (making that functionfloof.boop
), decorate the schema with#[pg_schema]
:For any functions have a custom
sql
block for (like below), update that to usepgxsql
now:Run
cargo pgx schema
again!If you have any trouble, try running
cargo pgx schema -v
and investigating the output. We made sure to update thecargo doc
output ofpgx
with updated usage for the various macros and derives, they might have some advice, too.You can ask us questions via issues here or Discord if you get stuck.
Thanks!
Thanks to @JLockerman (from @timescale) & @kpumuk for contributions! Also thanks to our early testers @rustprooflabs and @comdiv.