Installation
First, install pgrx by running cargo install --locked cargo-pgrx@version
, where version should be compatible with the pgrx version used by pg_graphql.
Then clone the repo and install using:
1 2 3 |
|
Before enabling the extension you need to initialize pgrx
. The easiest way to get started is to allow pgrx
to manage its own version/s of Postgres:
1 |
|
For more advanced configuration options, like building against an existing Postgres installation from e.g. Homebrew, see the pgrx docs
To start the database:
1 |
|
To connect:
1 |
|
Finally, to enable the pg_graphql
extension in Postgres, execute the create extension
statement. This extension creates its own schema/namespace named graphql
to avoid naming conflicts.
1 |
|
These steps ensure that pgrx
is properly initialized, and the database is started and connected before attempting to install and use the pg_graphql
extension.