
postgres://USERNAME:PASSWORD@HOSTNAME_OR_IP_ADDRESS:PORT/database_nameAs many hosted databases have limits on the number of unique connections they can manage, Hyperdrive attempts to keep number of concurrent pooled connections to your origin database lower.


Optimized Host: aws.connect.psdb.cloud or Direct which in my case is eu-central.connect.psdb.cloud?ssl={"rejectUnauthorized":true} at the end, should I keep it?import { createConnection } from "mysql2/promise"; whereas kysely says import { createPool } from 'mysql2' // do not use 'mysql2/promises'! (https://www.kysely.dev/docs/getting-started?package-manager=pnpm&dialect=mysql#instantiationconnectionLimit? Default in kysely docs is 10Optimized Host will likely just add a layer of complexity since they'll be trying to also handle global routing.createConnection is correct. Note that because of the way Hyperdrive works, it's safe and recommended to create a new connection on every request (and terminate the connection after each request using ctx.waitUntil).createConnection even has a connectionLimit param because it's not pooling anyway...)MysqlDialect only supports pool connection it seems cloudflared container in the same network.<random_name>.<my_domain>.com/mysq://... with TCP typepostgres.js and {prepare: true}. Are transactions known not to work with hyperdrive at all?wrangler dev --remote works perfectlypostgres(connStr, {max: 5, fetch_types: false,}) (not that I need more than one connection but the docs suggested setting max to 5) and I have the cache disabled since the purpose of my query is to catch updates to a counter due to mutations by other clients. My app is not yet publicly released, so there is very little traffic.binary and text. Postgres.js uses the binary format, while node-postgres uses the text format. float or timestamp. const connection = await mysql.createConnection({
host: host,
user: username,
password: password,
database: database,
port: port,
disableEval: true,
connectTimeout: 1000,
ssl: {
rejectUnauthorized: true,
}
});app.all("*", async (c, next) => {
const sql = postgres(c.env.database.connectionString, {
max: 5,
fetch_types: false
});
const db = drizzle(sql);
c.set("database", db);
await next()
})<random_name>.<my_domain>.com/mysq://...{prepare: true}postgres(connStr, {max: 5, fetch_types: false,})binaryfloattimestampimport { Context } from 'hono';
import postgres from 'postgres';
const db = (c: Context) => {
console.log('Connecting to database...');
console.log(c.env.HYPERDRIVE.connectionString);
const connectionString = c.env.HYPERDRIVE?.connectionString;
return postgres(connectionString, {
fetch_types: false
});
};
export default db;Connecting to database...
postgresql://neondb_owner:*************@91a7****************d1e4c29.hyperdrive.local:5432/neondb?sslmode=disable
✘ [ERROR] PostgresError: connection is insecure (try using `sslmode=require`)