You will need to have pgrx
installed. First make sure that you have system
dependencies required by
pgrx.
Now you can install cargo-pgrx
but make sure to install the same version
that's used by this extension:
cargo install --locked --version 0.12.6 cargo-pgrx
Let's initialize pgrx.
cargo pgrx init
It's time to run pg_session_jwt
locally. Please note that pg_session_jwt.jwk
parameter MUST be set when new connection is created (for more details please
refer to the README file).
MY_JWK=...
export PGOPTIONS="-c pg_session_jwt.jwk=$MY_JWK"
cargo pgrx run pg16
Eventually you will be logged into postgres so now you can run:
CREATE EXTENSION pg_session_jwt;
Now you can explore available functions with
\dx auth.*
If you introduce new function make sure to reload the extension with
DROP EXTENSION pg_session_jwt;
CREATE EXTENSION pg_session_jwt;
You can lint your code with
rustfmt src/*.rs tests/*.rs
cargo clippy --fix --allow-staged
You can run test-suite
cargo test