Skip to content

Commit

Permalink
fix(store-indexer): disable prepared statements (#2058)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Dec 11, 2023
1 parent d32691b commit 392c4b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
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

0 comments on commit 392c4b8

Please sign in to comment.