Hyperdrive
Manage Hyperdrive database configurations using Wrangler.
To manage mTLS client certificates and CA chain certificates used by Hyperdrive, refer to Certificate commands.
Create a Hyperdrive config
npx wrangler hyperdrive create [NAME]pnpm wrangler hyperdrive create [NAME]yarn wrangler hyperdrive create [NAME]-
[NAME]stringrequiredThe name of the Hyperdrive config
-
--connection-stringstringThe connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database
-
--origin-hoststringalias: --hostThe host of the origin database
-
--origin-portnumberalias: --portThe port number of the origin database
-
--origin-schemestringalias: --scheme default: postgresqlThe scheme used to connect to the origin database
-
--databasestringThe name of the database within the origin database
-
--origin-userstringalias: --userThe username used to connect to the origin database
-
--origin-passwordstringalias: --passwordThe password used to connect to the origin database
-
--access-client-idstringThe Client ID of the Access token to use when connecting to the origin database
-
--access-client-secretstringThe Client Secret of the Access token to use when connecting to the origin database
-
--caching-disabledbooleanDisables the caching of SQL responses
-
--max-agenumberSpecifies max duration for which items should persist in the cache, cannot be set when caching is disabled
-
--swrnumberIndicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled
-
--ca-certificate-idstringalias: --ca-certificate-uuidSets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.
-
--mtls-certificate-idstringalias: --mtls-certificate-uuidSets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.
-
--sslmodestringSets sslmode for connecting to database. For PostgreSQL: 'require, verify-ca, verify-full'. For MySQL: 'REQUIRED, VERIFY_CA, VERIFY_IDENTITY'.
-
--origin-connection-limitnumberThe (soft) maximum number of connections that Hyperdrive may establish to the origin database
-
--bindingstringThe binding name of this resource in your Worker
-
--update-configbooleanAutomatically update your config file with the newly added resource
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Delete a Hyperdrive config
npx wrangler hyperdrive delete [ID]pnpm wrangler hyperdrive delete [ID]yarn wrangler hyperdrive delete [ID]-
[ID]stringrequiredThe ID of the Hyperdrive config
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Get a Hyperdrive config
npx wrangler hyperdrive get [ID]pnpm wrangler hyperdrive get [ID]yarn wrangler hyperdrive get [ID]-
[ID]stringrequiredThe ID of the Hyperdrive config
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
List Hyperdrive configs
npx wrangler hyperdrive listpnpm wrangler hyperdrive listyarn wrangler hyperdrive listGlobal flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources
Update a Hyperdrive config
npx wrangler hyperdrive update [ID]pnpm wrangler hyperdrive update [ID]yarn wrangler hyperdrive update [ID]-
[ID]stringrequiredThe ID of the Hyperdrive config
-
--namestringGive your config a new name
-
--connection-stringstringThe connection string for the database you want Hyperdrive to connect to - ex: protocol://user:password@host:port/database
-
--origin-hoststringalias: --hostThe host of the origin database
-
--origin-portnumberalias: --portThe port number of the origin database
-
--origin-schemestringalias: --schemeThe scheme used to connect to the origin database
-
--databasestringThe name of the database within the origin database
-
--origin-userstringalias: --userThe username used to connect to the origin database
-
--origin-passwordstringalias: --passwordThe password used to connect to the origin database
-
--access-client-idstringThe Client ID of the Access token to use when connecting to the origin database
-
--access-client-secretstringThe Client Secret of the Access token to use when connecting to the origin database
-
--caching-disabledbooleanDisables the caching of SQL responses
-
--max-agenumberSpecifies max duration for which items should persist in the cache, cannot be set when caching is disabled
-
--swrnumberIndicates the number of seconds cache may serve the response after it becomes stale, cannot be set when caching is disabled
-
--ca-certificate-idstringalias: --ca-certificate-uuidSets custom CA certificate when connecting to origin database. Must be valid UUID of already uploaded CA certificate.
-
--mtls-certificate-idstringalias: --mtls-certificate-uuidSets custom mTLS client certificates when connecting to origin database. Must be valid UUID of already uploaded public/private key certificates.
-
--sslmodestringSets sslmode for connecting to database. For PostgreSQL: 'require, verify-ca, verify-full'. For MySQL: 'REQUIRED, VERIFY_CA, VERIFY_IDENTITY'.
-
--origin-connection-limitnumberThe (soft) maximum number of connections that Hyperdrive may establish to the origin database
Global flags
-
--vbooleanalias: --versionShow version number
-
--cwdstringRun as if Wrangler was started in the specified directory instead of the current working directory
-
--configstringalias: --cPath to Wrangler configuration file
-
--envstringalias: --eEnvironment to use for operations, and for selecting .env and .dev.vars files
-
--env-filestringPath to an .env file to load - can be specified multiple times - values from earlier files are overridden by values in later files
-
--experimental-provisionbooleanaliases: --x-provision default: trueExperimental: Enable automatic resource provisioning
-
--experimental-auto-createbooleanalias: --x-auto-create default: trueAutomatically provision draft bindings with new resources