Here's how to get started working on pg_idkit locally.
To work on pg_idkit, you'll need the following:
- Rust toolchain (via
rustup) cargo-pgrx(see below for more details)cargo-getjust(see below for more details)- (optional)
git-crypt(for working with secrets) - (optional) direnv
- (optional) Docker
- (optional)
cargo-watch
This project uses a task runner similar to make called just. You can install it easily with cargo:
cargo install --locked justThe PGRX project is the magic behind this extension, exposing an easy-to-program interface in Rust for Postgres extensions.
To install it:
cargo install --locked cargo-pgrx@0.15.0
cargo pgrx initTo build the project:
just buildTo run the build continuously for quicker local development (assuming you have cargo-watch installed):
just build-watchNote that you can use the pgrx-documented development flow as well (using cargo pgrx) as well, for example:
cargo pgrx run pg15To run the tests:
just testTo run tests continuously for quicker local development (requires cargo-watch):
just build-test-watchAssuming you have Docker installed, to start a local Postgres instance first you must build a postgres docker image with pg_idkit:
just imageThen start the container:
just db-localYou may attach to the local DB with psql and execute commands:
just db-local-psql