This is an example for issue #144 on @neondatabase/serverless.
The application throws a error: NeonDbError: prepared statement "sX" does not exist
when performing multiple parallel DB requests.
You should have a JWKS endpoint running, for this example it doesn't really matter what JWKS endpoint we use.
Besides that you should have a valid access token which is signed with the keys from the JWKS endpoint.
Enable RLS Authorize, this is where you provide the JWKS endpoint from the prerequisite.
Apply the proposed queries under Set up Extension and Roles Privileges
:
- Install the extension in the neondb database:
- Grant privileges to the roles in the neondb database:
pnpm install
You can copy the .dev.vars.example
file to .dev.vars
and modify the variables:
cp .dev.vars.example .dev.vars
Modify the following variables:
DATABASE_URL
: the pooling URL from Neon from theneondb_owner
roleAUTHENTICATED_DATABASE_URL
: the pooling URL from Neon from theauthenticated
roleJWT_TOKEN
: a valid access token which is signed with the keys from the JWKS endpoint (see prerequisite)
pnpm drizzle-kit migrate
pnpm run dev
Now that the server is running, visit/request the /
route: http://localhost:8787/.
Observed behavior:
- Some of the requests will fail with a
error: NeonDbError: prepared statement "sX" does not exist