mapFound: true on occasion. Logging in pages functions is very limited, but we we were able to reproduce the bug by barraging the API with requests until it falsely returns mapFound: true.maps table doesn't change often - a few modifications a day at best. Seems like a hyperdrive bug to me, but I don't have any evidence to support it except for the info provided above.map.geoguessrId !== params.geoguessrId as a bandaid fix in a desperate attempt to fix it and it seems to be doing the trick. No idea what map object is being returned, logging would really help PostgresError: Internal error from Hyperdrive.
cloudflared running in a docker container and the postgres bitnami contianer running but keep receiving this error when creating my hyperdrive config via Pulumi with v6.1.0:prepare: false and prepare: true and neither seem to make a big difference to the times...--ca-certificate-id and --mtls-certificate-id are specified.node-postgres:With node-postgres, you can install pg-native to boost the speed of both node-postgres and Drizzle by approximately 10%.This won't matter on Workers because Workers doesn't support native extensions.
node-postgres supports providing type parsers on a per-query basis without globally patching things. For more details, see Types Docs.Seems valid but probably somewhat of an advanced use-case?
postgres.js uses prepared statements by default, which you may need to opt out of. This could be a potential issue in AWS environments, among others, so please keep that in mind.Hyperdrive fully supports prepared statements now, and they improve performance so this is probably a benefit of
postgres.js actually// Clean up the connectionAlso, AJR explained why this was a good idea a while back, but might be good to add a line claryfing this in the docs because people might generally assume it's bad practice to close connections on every request.
ctx.waitUntil(sql.end());
max set to 5, so just porting that to the new docs would be good const map = await db.query.maps.findFirst({
where: eq(maps.geoguessrId, params.geoguessrId)
});
if (!map) {
return json({ mapFound: false }, { status: 404 });
}
return json({
mapFound: true
});failed to make http request: POST "https://api.cloudflare.com/client/v4/accounts/<redacted>/hyperdrive/configs": 400 Bad Request {
"result": null,
"success": false,
"errors": [
{
"code": 2011,
"message": "Network connection to the provided database was refused. Please check the that host and port are correct and that the database allows connections from public IP addresses
."
}
],
"messages": null
}await sql`select 'hello' as "message";`await sql`select ${'hello'} as "message";`prepare: falseprepare: true--ca-certificate-id--mtls-certificate-idnode-postgrespostgres.jsmax