Skip to content

v1.0.0

Compare
Choose a tag to compare
@eeeebbbbrrrr eeeebbbbrrrr released this 03 Apr 21:30
· 109 commits to main since this release
a2cbbfc

We are excited to present PL/Rust v1.0.0. Writing Postgres UDFs in Rust has never been easier (mostly because it hasn't been possible)!

PL/Rust is a loadable, trusted procedural language handler enabling developers to create PostgreSQL functions in the Rust programming language. Unlike other procedural languages, PL/Rust functions are not interpreted. Instead, the definition you supply to CREATE FUNCTION ... LANGUAGE plrust is wrapped in Rust, compiled to native machine code, and dynamically loaded.

Many of the usual tradeoffs of compilation apply:

  • Compilation can be slow
  • Execution can be very fast, often ×10 faster than PL/pgSQL!
  • Types are static and must be explicitly handled
  • Code can be fully analyzed and errors caught at compile time
  • PL/Rust must understand both what it compiles and how to compile, so 1.0 currently only supports some Postgres types and Rust targets

However, many other burdens of compiling native ("C") functions are removed. PL/Rust can transparently reload, recompile, and replace functions without additional prompting, as if it was any other procedural language. Documentation, while still under development, can be found here: https://tcdi.github.io/plrust/

Please feel free to open an issue if you have any additional questions!

Platform Support

  • x86-64 and aarch64 Linux are supported for host compilation with Postgres 13, 14, and 15
  • Cross-compiling between x86-64 and aarch64 for replication purposes may be enabled with the latest update of Debian Bullseye using a Rust toolchain obtained from https://rustup.rs and other setups may be enabled by user configuration on other distributions
  • Trusted PL/Rust is supported for Rust 1.67.1
  • Untrusted PL/Rust may be built for development purposes on macOS

Thanks Everyone!

We want to make sure to properly thank all the past (and hopefully future!) PL/Rust contributors. Without their work, PL/Rust wouldn't exist. Thank you! 🙏

Also, a huge thanks to TCDI for funding this work and putting together an absolutely outstanding team.

What's Changed Since v1.0.0-rc.1

plrustc Lints

  • Add a lint to plug autotrait impl soundness hole by @thomcc in #263
  • Add a lint for 'static impl shenanigans by @thomcc in #265
  • Add a lint for certain suspicious trait object usage by @thomcc in #264
  • Enable the where_clauses_object_safety lint by default by @thomcc in #268
  • Use early_error to emit early errors by @thomcc in #272
  • Move lints into their own file by @thomcc in #271

Documentation

Miscellaneous Niceties

  • Only set -Clink-args=-Wl,-undefined,dynamic_lookup on macos by @thomcc in #273
  • Ability to decide, at compile time, which "plrust-trusted-pgx" crate user functions should use by @eeeebbbbrrrr in #276

Full Changelog: v1.0.0-rc.1...v1.0.0