Skip to content

Commit e099bc0

Browse files
knickishknickish
andauthored
Note the requirement for prepare: true in postgres.js hyperdrive documentation to allow caching (#26416)
Co-authored-by: knickish <[email protected]>
1 parent 7738a81 commit e099bc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/content/partials/hyperdrive/use-postgres-js-to-make-query.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ export default {
3535
max: 5,
3636
// If you are not using array types in your Postgres schema, disable `fetch_types` to avoid an additional round-trip (unnecessary latency)
3737
fetch_types: false,
38+
39+
// This is set to true by default, but certain query generators such as Kysely or queries using sql.unsafe() will set this to false. Hyperdrive will not cache prepared statements when this option is set to false and will require additional round-trips.
40+
prepare: true,
3841
});
3942

4043
try {

0 commit comments

Comments
 (0)