Skip to content
Start here

Hyperdrive

ModelsExpand Collapse
type Hyperdrive struct{…}
ID string

Define configurations using a unique string identifier.

maxLength32
Name string

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

maxLength2048
Origin HyperdriveOrigin

Combines database connection fields with exactly one supported network location.

One of the following:
HyperdriveOriginPublicDatabase
Database string

Set the name of your origin database.

maxLength2048
Host string

Defines the publicly reachable hostname or IP of your origin database. Private, loopback, and link-local IP addresses are not allowed.

Password string

Set the password needed to access your origin database. The API never returns this write-only value.

maxLength2048
Port int64

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

maximum65535
minimum1
Scheme HyperdriveOriginPublicDatabaseScheme

Specifies the URL scheme used to connect to your origin database.

One of the following:
const HyperdriveOriginPublicDatabaseSchemePostgres HyperdriveOriginPublicDatabaseScheme = "postgres"
const HyperdriveOriginPublicDatabaseSchemePostgresql HyperdriveOriginPublicDatabaseScheme = "postgresql"
const HyperdriveOriginPublicDatabaseSchemeMysql HyperdriveOriginPublicDatabaseScheme = "mysql"
User string

Set the user of your origin database.

maxLength2048
HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnel
AccessClientID string

Defines the Client ID of the Access token to use when connecting to the origin database.

AccessClientSecret string

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

Database string

Set the name of your origin database.

maxLength2048
Host string

Defines the host (hostname or IP) of your origin database.

Password string

Set the password needed to access your origin database. The API never returns this write-only value.

maxLength2048
Scheme HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme

Specifies the URL scheme used to connect to your origin database.

One of the following:
const HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgres HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgres"
const HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgresql HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgresql"
const HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemeMysql HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "mysql"
User string

Set the user of your origin database.

maxLength2048
HyperdriveOriginDatabaseReachableThroughAWorkersVPC
Database string

Set the name of your origin database.

maxLength2048
Password string

Set the password needed to access your origin database. The API never returns this write-only value.

maxLength2048
Scheme HyperdriveOriginDatabaseReachableThroughAWorkersVPCScheme

Specifies the URL scheme used to connect to your origin database.

One of the following:
const HyperdriveOriginDatabaseReachableThroughAWorkersVPCSchemePostgres HyperdriveOriginDatabaseReachableThroughAWorkersVPCScheme = "postgres"
const HyperdriveOriginDatabaseReachableThroughAWorkersVPCSchemePostgresql HyperdriveOriginDatabaseReachableThroughAWorkersVPCScheme = "postgresql"
const HyperdriveOriginDatabaseReachableThroughAWorkersVPCSchemeMysql HyperdriveOriginDatabaseReachableThroughAWorkersVPCScheme = "mysql"
ServiceID string

The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.

User string

Set the user of your origin database.

maxLength2048
Caching HyperdriveCachingOptional
One of the following:
HyperdriveCachingHyperdriveHyperdriveCachingCommon
Disabled boolOptional

Set to true to disable caching of SQL responses. Default is false.

HyperdriveCachingHyperdriveHyperdriveCachingEnabled
Disabled boolOptional

Set to true to disable caching of SQL responses. Default is false.

MaxAge int64Optional

Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.

StaleWhileRevalidate int64Optional

Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.

CreatedOn TimeOptional

Defines the creation time of the Hyperdrive configuration.

formatdate-time
ModifiedOn TimeOptional

Defines the last modified time of the Hyperdrive configuration.

formatdate-time
MTLS HyperdriveMTLSOptional

mTLS configuration for the origin connection. Cannot be used with VPC Service origins; TLS must be managed on the VPC Service.

CACertificateID stringOptional

Define CA certificate ID obtained after uploading CA cert.

MTLSCertificateID stringOptional

Define mTLS certificate ID obtained after uploading client cert.

Sslmode stringOptional

PostgreSQL accepts require, verify-ca, and verify-full. MySQL accepts REQUIRED, VERIFY_CA, and VERIFY_IDENTITY. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.

OriginConnectionLimit int64Optional

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Certain Cloudflare-managed origins may be permitted a higher limit. Contact Cloudflare if you need a higher limit.

minimum5
RestartedOn TimeOptional

Defines the last time the Hyperdrive connection pool was explicitly restarted via the restart endpoint. Omitted if the pool has never been explicitly restarted.

formatdate-time

HyperdriveConfigs

List Hyperdrives
client.Hyperdrive.Configs.List(ctx, params) (*V4PagePaginationArray[ConfigListResponse], error)
GET/accounts/{account_id}/hyperdrive/configs
Get Hyperdrive
client.Hyperdrive.Configs.Get(ctx, hyperdriveID, query) (*ConfigGetResponse, error)
GET/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Create Hyperdrive
client.Hyperdrive.Configs.New(ctx, params) (*ConfigNewResponse, error)
POST/accounts/{account_id}/hyperdrive/configs
Replace Hyperdrive
client.Hyperdrive.Configs.Update(ctx, hyperdriveID, params) (*ConfigUpdateResponse, error)
PUT/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Update Hyperdrive
client.Hyperdrive.Configs.Edit(ctx, hyperdriveID, params) (*ConfigEditResponse, error)
PATCH/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Restart Hyperdrive
client.Hyperdrive.Configs.Restart(ctx, hyperdriveID, body) (*ConfigRestartResponse, error)
POST/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}/restart
Delete Hyperdrive
client.Hyperdrive.Configs.Delete(ctx, hyperdriveID, body) (*ConfigDeleteResponse, error)
DELETE/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}