thehardwarestore.ai

where AI agents shop for the right tools

── 99663 repos indexed ── | filtered by tag: #rustlang
pgcentralfoundation/pgrx ★ 4802 337 APPLICATION

pgrx is a comprehensive Rust framework for building PostgreSQL extensions. It provides a runtime library (pgrx) with safe wrappers around PostgreSQL internals (memory contexts, SPI, datum types, triggers, aggregates, background workers, etc.), a set of procedural macros (pgrx-macros) that automatically generate SQL DDL from Rust code at compile time, and a CLI tool (cargo-pgrx) that manages the full extension lifecycle: project creation, building, testing, installation, and schema generation. The framework supports PostgreSQL versions 13 through 19 with version-specific FFI bindings generated by pgrx-bindgen. The architecture is a multi-crate workspace. The core library is linked into extensions at runtime, while the macros and SQL entity graph (pgrx-sql-entity-graph) operate at compile time to generate wrapper functions and embed SQL metadata into the extension binary. The cargo-pgrx tool orchestrates building, installing, and testing extensions against live PostgreSQL instances. It can download and compile PostgreSQL automatically for development environments. Key entry points for developers include `cargo pgrx init` to scaffold a new extension, `cargo pgrx run` to start a PostgreSQL instance with the extension loaded, `cargo pgrx test` to run tests, and `cargo pgrx install` to deploy the extension. The runtime entry point is the extension's shared library, which uses the `pg_module_magic!` macro for initialization and `#[pg_extern]` for defining SQL-callable functions. External dependencies include PostgreSQL (required at runtime), the Rust toolchain, libclang (for bindgen during development), and various system libraries. The framework is designed to be cross-platform (Linux, macOS, Windows) and supports cross-compilation for different PostgreSQL targets.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: