Skip to content

Hyperdrive

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8158

readonly connectionString: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8176

A valid DB connection string that can be passed straight into the typical client library/driver/ORM. This will typically be the easiest way to use Hyperdrive.


readonly database: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8203


readonly host: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8183


readonly password: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8199


readonly port: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8187


readonly user: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8192

connect(): Socket

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250923.0/node_modules/@cloudflare/workers-types/index.ts:8170

Connect directly to Hyperdrive as if it’s your database, returning a TCP socket.

Calling this method returns an idential socket to if you call connect("host:port") using the host and port fields from this object. Pick whichever approach works better with your preferred DB client library.

Note that this socket is not yet authenticated — it’s expected that your code (or preferably, the client library of your choice) will authenticate using the information in this class’s readonly fields.

Socket