Who will win, docs aside or https://github.com/cloudflare/workerd/pull/1266/
GitHub
Adda a new binding type Hyperdrive as well as a corresponding Service definition ExternalTcpService that allows TCP connections to the designated host address & port




Postgres.js 3.4.0
pg driver, but if we're using @neondatabase/serverless or similar I'd expect their optimizations to reduce round trips would make it closer at leastCannot read properties of undefined (reading 'connectionString')Postgres.js3.4.0import { Client } from 'pg';
import { Hono, MiddlewareHandler } from 'hono';
type Bindings = {
HYPERDRIVE: Hyperdrive;
};
const app = new Hono<{
Bindings: Bindings;
Variables: {
DB: Client;
};
}>();
const dbMiddleware: MiddlewareHandler = async (c, next) => {
c.set('DB', new Client({ connectionString: c.env.HYPERDRIVE.connectionString }));
await next();
};
app.get('/', dbMiddleware, async (c) => {
try {
// Connect to our database
await c.var.DB.connect();
// Test query
let result = await c.var.DB.query({ text: 'SELECT * FROM pg_tables' });
// Return result rows as JSON
return c.json(result);
} catch (e) {
console.log(e);
return Response.json({ error: JSON.stringify(e) }, { status: 500 });
}
});
export default app;@neondatabase/serverless