Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(store-indexer): disable prepared statements #2058

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rich-experts-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/store-indexer": patch
---

Disabled prepared statements for the postgres indexer, which led to issues in combination with `pgBouncer`.
2 changes: 1 addition & 1 deletion packages/store-indexer/bin/postgres-frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const env = parseEnv(
)
);

const database = postgres(env.DATABASE_URL);
const database = postgres(env.DATABASE_URL, { prepare: false });

const server = new Koa();

Expand Down
2 changes: 1 addition & 1 deletion packages/store-indexer/bin/postgres-indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const publicClient = createPublicClient({
});

const chainId = await publicClient.getChainId();
const database = drizzle(postgres(env.DATABASE_URL));
const database = drizzle(postgres(env.DATABASE_URL, { prepare: false }));

if (await shouldCleanDatabase(database, chainId)) {
console.log("outdated database detected, clearing data to start fresh");
Expand Down