Skip to content
Start here

Hyperdrive

ModelsExpand Collapse
type Configuration interface{…}
One of the following:
ConfigurationHyperdriveInternetOrigin
Host string

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

Port int64

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

Database stringoptional

Set the name of your origin database.

Password stringoptional

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

Scheme ConfigurationHyperdriveInternetOriginSchemeoptional

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

One of the following:
const ConfigurationHyperdriveInternetOriginSchemePostgres ConfigurationHyperdriveInternetOriginScheme = "postgres"
const ConfigurationHyperdriveInternetOriginSchemePostgresql ConfigurationHyperdriveInternetOriginScheme = "postgresql"
const ConfigurationHyperdriveInternetOriginSchemeMysql ConfigurationHyperdriveInternetOriginScheme = "mysql"
User stringoptional

Set the user of your origin database.

ConfigurationHyperdriveOverAccessOrigin
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.

Host string

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

Database stringoptional

Set the name of your origin database.

Password stringoptional

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

Scheme ConfigurationHyperdriveOverAccessOriginSchemeoptional

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

One of the following:
const ConfigurationHyperdriveOverAccessOriginSchemePostgres ConfigurationHyperdriveOverAccessOriginScheme = "postgres"
const ConfigurationHyperdriveOverAccessOriginSchemePostgresql ConfigurationHyperdriveOverAccessOriginScheme = "postgresql"
const ConfigurationHyperdriveOverAccessOriginSchemeMysql ConfigurationHyperdriveOverAccessOriginScheme = "mysql"
User stringoptional

Set the user of your origin database.

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.

Origin HyperdriveOrigin
One of the following:
type HyperdriveOriginPublicDatabase struct{…}
Database string

Set the name of your origin database.

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.

Port int64

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

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.

type HyperdriveOriginAccessProtectedDatabaseBehindCloudflareTunnel struct{…}
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.

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.

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.

Caching HyperdriveCachingoptional
One of the following:
type HyperdriveCachingHyperdriveHyperdriveCachingCommon struct{…}
Disabled booloptional

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

type HyperdriveCachingHyperdriveHyperdriveCachingEnabled struct{…}
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
CACertificateID stringoptional

Define CA certificate ID obtained after uploading CA cert.

MTLSCertificateID stringoptional

Define mTLS certificate ID obtained after uploading client cert.

Sslmode stringoptional

Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.

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. Contact Cloudflare if you need a higher limit.

maximum100
minimum5

HyperdriveConfigs

List Hyperdrives
client.Hyperdrive.Configs.List(ctx, query) (*SinglePage[Hyperdrive], error)
GET/accounts/{account_id}/hyperdrive/configs
Get Hyperdrive
client.Hyperdrive.Configs.Get(ctx, hyperdriveID, query) (*Hyperdrive, error)
GET/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Create Hyperdrive
client.Hyperdrive.Configs.New(ctx, params) (*Hyperdrive, error)
POST/accounts/{account_id}/hyperdrive/configs
Update Hyperdrive
client.Hyperdrive.Configs.Update(ctx, hyperdriveID, params) (*Hyperdrive, error)
PUT/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Patch Hyperdrive
client.Hyperdrive.Configs.Edit(ctx, hyperdriveID, params) (*Hyperdrive, error)
PATCH/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}
Delete Hyperdrive
client.Hyperdrive.Configs.Delete(ctx, hyperdriveID, body) (*ConfigDeleteResponse, error)
DELETE/accounts/{account_id}/hyperdrive/configs/{hyperdrive_id}