question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

db error: ERROR: prepared statement "s0" does not exist

See original GitHub issue

Bug description

Error: Error in connector: Error querying the database: Error querying the database: Error querying the database: db error: ERROR: prepared statement “s0” does not exist

How to reproduce

INDEXER_DATABASE_URL=“postgresql://public_readonly:nearprotocol@mainnet.db.explorer.indexer.near.dev/mainnet_explorer?schema=public” DEBUG=prisma:* npx prisma db pull

Expected behavior

schema.prisma should be updated from the Postgresql database instead of throwing an error.

Prisma information

schema.prisma:

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("INDEXER_DATABASE_URL")
}

Environment & setup

  • OS: MacOS
  • Database: PostgreSQL
  • Node.js version: 16.x

Prisma Version

prisma                  : 3.9.2
@prisma/client          : 3.9.2
Current platform        : darwin
Query Engine (Node-API) : libquery-engine bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/prisma/node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine        : migration-engine-cli bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/prisma/node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine    : introspection-core bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/prisma/node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary           : prisma-fmt bcc2ff906db47790ee902e7bbc76d7ffb1893009 (at node_modules/prisma/node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash    : bcc2ff906db47790ee902e7bbc76d7ffb1893009
Studio                  : 0.457.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
winreycommented, May 21, 2022

It’s strange, after generate schema and client from near-indexer-for-explorer, it throw error when use rawQuery.

But it’s fine when use the db of the testnet postgresql://public_readonly:nearprotocol@testnet.db.explorer.indexer.near.dev/testnet_explorer?schema=public. &pgbouncer=true doesn’t help.

0reactions
neeeekitoscommented, Aug 15, 2022

@winrey did you find a workaround for a mainnet db?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Prisma Client with PgBouncer
PgBouncer holds a connection pool to the database and proxies incoming client ... Error querying the database: db error: ERROR: prepared statement "s0" ......
Read more >
Davis on Twitter: "@TedSpare @supabase @prisma @nextjs ...
Error : undefined: Database error Error querying the database: db error: ERROR: prepared statement "s0" already exists" / Twitter ...
Read more >
pq driver: prepared statement does not exist - Stack Overflow
If a Conn does not implement Queryer , the sql package's DB.Query will first prepare a query, execute the statement, and then close...
Read more >
[Guide] Migrations & Connection Pool URLs (Supabase)
They don't necessarily let go of the database connections. ... the database: db error: ERROR: prepared statement "s0" already exists.
Read more >
Prisma - Supabase
Connect your Supabase postgres database to your Prisma project. ... 2Error querying the database: db error: ERROR: prepared statement “s0” already exists.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found