import { Client } from '../client.js'; import { Models } from '../models.js'; import 'undici'; import '../query.js'; import '../enums/database-type.js'; import '../enums/attribute-status.js'; import '../enums/column-status.js'; import '../enums/index-status.js'; import '../enums/deployment-status.js'; import '../enums/execution-resource-type.js'; import '../enums/execution-trigger.js'; import '../enums/execution-status.js'; import '../enums/project-auth-method-id.js'; import '../enums/project-service-id.js'; import '../enums/project-protocol-id.js'; import '../enums/o-auth-2-google-prompt.js'; import '../enums/o-auth-2-oidc-prompt.js'; import '../enums/platform-type.js'; import '../enums/proxy-rule-deployment-resource-type.js'; import '../enums/proxy-rule-status.js'; import '../enums/message-status.js'; import '../enums/billing-plan-group.js'; declare class Mysql { client: Client; constructor(client: Client); /** * List all dedicated databases. Results support pagination. * * @param {string[]} params.queries - Array of query strings. * @throws {AppwriteException} * @returns {Promise} */ list(params?: { queries?: string[]; }): Promise; /** * List all dedicated databases. Results support pagination. * * @param {string[]} queries - Array of query strings. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ list(queries?: string[]): Promise; /** * Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready. * * @param {string} params.databaseId - Database ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Database display name. Max length: 128 chars. * @param {string} params.version - Database engine version. Defaults to latest for selected engine. * @param {string} params.specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds. * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} params.idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} params.pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} params.pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} */ create(params: { databaseId: string; name: string; version?: string; specification?: string; replicas?: number; syncMode?: string; networkIdleTimeoutSeconds?: number; networkIPAllowlist?: string[]; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; storageAutoscalingMaxGb?: number; }): Promise; /** * Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready. * * @param {string} databaseId - Database ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Database display name. Max length: 128 chars. * @param {string} version - Database engine version. Defaults to latest for selected engine. * @param {string} specification - Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling. * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds. * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} idleTimeoutMinutes - Minutes of inactivity before container scales to zero. * @param {boolean} pitr - Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window. * @param {number} pitrRetentionDays - Number of days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ create(databaseId: string, name: string, version?: string, specification?: string, replicas?: number, syncMode?: string, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number): Promise; /** * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization. * * @throws {AppwriteException} * @returns {Promise} */ listSpecifications(): Promise; /** * Get a dedicated database by its unique ID. Returns the database configuration and current status. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ get(params: { databaseId: string; }): Promise; /** * Get a dedicated database by its unique ID. Returns the database configuration and current status. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ get(databaseId: string): Promise; /** * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} params.databaseId - Database ID. * @param {string} params.name - Database display name. * @param {string} params.status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. * @param {string} params.specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. * @param {number} params.replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} params.syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} params.networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). * @param {string[]} params.networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} params.idleTimeoutMinutes - Minutes before container scales to zero. * @param {boolean} params.pitr - Enable or disable point-in-time recovery (PITR). * @param {number} params.pitrRetentionDays - Days to retain PITR data. * @param {boolean} params.storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} params.storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. * @param {number} params.storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. * @param {number} params.metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. * @param {number} params.metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. * @param {boolean} params.sqlApiEnabled - Enable the SQL API sidecar for this database. * @param {string[]} params.sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. * @param {number} params.sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). * @param {number} params.sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). * @param {number} params.sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise} */ update(params: { databaseId: string; name?: string; status?: string; specification?: string; replicas?: number; syncMode?: string; networkIdleTimeoutSeconds?: number; networkIPAllowlist?: string[]; idleTimeoutMinutes?: number; pitr?: boolean; pitrRetentionDays?: number; storageAutoscaling?: boolean; storageAutoscalingThresholdPercent?: number; storageAutoscalingMaxGb?: number; metricsTraceSampleRate?: number; metricsSlowQueryLogThresholdMs?: number; sqlApiEnabled?: boolean; sqlApiAllowedStatements?: string[]; sqlApiMaxRows?: number; sqlApiMaxBytes?: number; sqlApiTimeoutSeconds?: number; }): Promise; /** * Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place. * * @param {string} databaseId - Database ID. * @param {string} name - Database display name. * @param {string} status - Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database. * @param {string} specification - Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime. * @param {number} replicas - Number of high availability replicas (0-5). High availability is enabled when greater than 0. * @param {string} syncMode - Replication sync mode preference. Allowed values: async, sync, quorum. * @param {number} networkIdleTimeoutSeconds - Connection idle timeout in seconds (60-86400). * @param {string[]} networkIPAllowlist - IP addresses/CIDR ranges allowed to connect. * @param {number} idleTimeoutMinutes - Minutes before container scales to zero. * @param {boolean} pitr - Enable or disable point-in-time recovery (PITR). * @param {number} pitrRetentionDays - Days to retain PITR data. * @param {boolean} storageAutoscaling - Enable automatic storage expansion when usage exceeds threshold. * @param {number} storageAutoscalingThresholdPercent - Storage usage percentage (50-95) that triggers automatic expansion. * @param {number} storageAutoscalingMaxGb - Maximum storage size in GB for autoscaling. 0 means no limit. * @param {number} metricsTraceSampleRate - Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar. * @param {number} metricsSlowQueryLogThresholdMs - Threshold in ms above which queries are logged as slow. Forwarded to the sidecar. * @param {boolean} sqlApiEnabled - Enable the SQL API sidecar for this database. * @param {string[]} sqlApiAllowedStatements - Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. * @param {number} sqlApiMaxRows - Maximum rows returned per SQL API execution (1-1000000). * @param {number} sqlApiMaxBytes - Maximum serialised SQL API result payload in bytes (1024-104857600). * @param {number} sqlApiTimeoutSeconds - Per-call SQL API execution timeout in seconds (1-300). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ update(databaseId: string, name?: string, status?: string, specification?: string, replicas?: number, syncMode?: string, networkIdleTimeoutSeconds?: number, networkIPAllowlist?: string[], idleTimeoutMinutes?: number, pitr?: boolean, pitrRetentionDays?: number, storageAutoscaling?: boolean, storageAutoscalingThresholdPercent?: number, storageAutoscalingMaxGb?: number, metricsTraceSampleRate?: number, metricsSlowQueryLogThresholdMs?: number, sqlApiEnabled?: boolean, sqlApiAllowedStatements?: string[], sqlApiMaxRows?: number, sqlApiMaxBytes?: number, sqlApiTimeoutSeconds?: number): Promise; /** * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ delete(params: { databaseId: string; }): Promise<{}>; /** * Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ delete(databaseId: string): Promise<{}>; /** * List all backups for a dedicated database. Results can be filtered by status and type. * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, type, databaseId * @throws {AppwriteException} * @returns {Promise} */ listBackups(params: { databaseId: string; queries?: string[]; }): Promise; /** * List all backups for a dedicated database. Results can be filtered by status and type. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, type, databaseId * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listBackups(databaseId: string, queries?: string[]): Promise; /** * Create a manual backup of a dedicated database. The backup will be created asynchronously and its status can be checked via the get backup endpoint. * * @param {string} params.databaseId - Database ID. * @param {string} params.type - Backup type: full or incremental. * @throws {AppwriteException} * @returns {Promise} */ createBackup(params: { databaseId: string; type?: string; }): Promise; /** * Create a manual backup of a dedicated database. The backup will be created asynchronously and its status can be checked via the get backup endpoint. * * @param {string} databaseId - Database ID. * @param {string} type - Backup type: full or incremental. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createBackup(databaseId: string, type?: string): Promise; /** * List scheduled backup policies for a dedicated database. * * @param {string} params.databaseId - Database ID. * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. * @throws {AppwriteException} * @returns {Promise} */ listBackupPolicies(params: { databaseId: string; queries?: string[]; }): Promise; /** * List scheduled backup policies for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listBackupPolicies(databaseId: string, queries?: string[]): Promise; /** * Create a scheduled backup policy for a dedicated database. * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} params.name - Policy name. Max length: 128 chars. * @param {string} params.schedule - Schedule CRON syntax. * @param {number} params.retention - Days to keep backups before deletion. * @param {string} params.type - Backup type: full or incremental. * @param {boolean} params.enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise} */ createBackupPolicy(params: { databaseId: string; policyId: string; name: string; schedule: string; retention: number; type?: string; enabled?: boolean; }): Promise; /** * Create a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {string} name - Policy name. Max length: 128 chars. * @param {string} schedule - Schedule CRON syntax. * @param {number} retention - Days to keep backups before deletion. * @param {string} type - Backup type: full or incremental. * @param {boolean} enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createBackupPolicy(databaseId: string, policyId: string, name: string, schedule: string, retention: number, type?: string, enabled?: boolean): Promise; /** * Get a scheduled backup policy for a dedicated database. * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. * @throws {AppwriteException} * @returns {Promise} */ getBackupPolicy(params: { databaseId: string; policyId: string; }): Promise; /** * Get a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getBackupPolicy(databaseId: string, policyId: string): Promise; /** * Update a scheduled backup policy for a dedicated database. * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. * @param {string} params.name - Policy name. Max length: 128 chars. * @param {string} params.schedule - Schedule CRON syntax. * @param {number} params.retention - Days to keep backups before deletion. * @param {boolean} params.enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise} */ updateBackupPolicy(params: { databaseId: string; policyId: string; name?: string; schedule?: string; retention?: number; enabled?: boolean; }): Promise; /** * Update a scheduled backup policy for a dedicated database. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. * @param {string} name - Policy name. Max length: 128 chars. * @param {string} schedule - Schedule CRON syntax. * @param {number} retention - Days to keep backups before deletion. * @param {boolean} enabled - Is policy enabled? When disabled, no backups will be taken. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateBackupPolicy(databaseId: string, policyId: string, name?: string, schedule?: string, retention?: number, enabled?: boolean): Promise; /** * Delete a scheduled backup policy for a dedicated database. Backups already taken by the policy are kept until their retention expires. * * @param {string} params.databaseId - Database ID. * @param {string} params.policyId - Policy ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteBackupPolicy(params: { databaseId: string; policyId: string; }): Promise<{}>; /** * Delete a scheduled backup policy for a dedicated database. Backups already taken by the policy are kept until their retention expires. * * @param {string} databaseId - Database ID. * @param {string} policyId - Policy ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteBackupPolicy(databaseId: string, policyId: string): Promise<{}>; /** * Configure off-cluster backup storage for a dedicated database. Supports S3, GCS, and Azure Blob Storage destinations. Backups will be stored to the configured destination in addition to on-cluster storage. * * @param {string} params.databaseId - Database ID. * @param {string} params.provider - Storage provider for off-cluster backups. Allowed values: s3 (Amazon S3 or S3-compatible), gcs (Google Cloud Storage), azure (Azure Blob Storage). * @param {string} params.bucket - Storage bucket or container name. * @param {string} params.accessKey - Access key or client ID for authentication. * @param {string} params.secretKey - Secret key or service account JSON for authentication. * @param {string} params.region - Storage region. * @param {string} params.prefix - Object key prefix for backups. * @param {string} params.endpoint - Custom endpoint for S3-compatible storage (e.g. MinIO). * @throws {AppwriteException} * @returns {Promise} */ updateBackupStorage(params: { databaseId: string; provider: string; bucket: string; accessKey: string; secretKey: string; region?: string; prefix?: string; endpoint?: string; }): Promise; /** * Configure off-cluster backup storage for a dedicated database. Supports S3, GCS, and Azure Blob Storage destinations. Backups will be stored to the configured destination in addition to on-cluster storage. * * @param {string} databaseId - Database ID. * @param {string} provider - Storage provider for off-cluster backups. Allowed values: s3 (Amazon S3 or S3-compatible), gcs (Google Cloud Storage), azure (Azure Blob Storage). * @param {string} bucket - Storage bucket or container name. * @param {string} accessKey - Access key or client ID for authentication. * @param {string} secretKey - Secret key or service account JSON for authentication. * @param {string} region - Storage region. * @param {string} prefix - Object key prefix for backups. * @param {string} endpoint - Custom endpoint for S3-compatible storage (e.g. MinIO). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateBackupStorage(databaseId: string, provider: string, bucket: string, accessKey: string, secretKey: string, region?: string, prefix?: string, endpoint?: string): Promise; /** * Get details of a specific database backup including its status, size, and timestamps. * * @param {string} params.databaseId - Database ID. * @param {string} params.backupId - Backup ID. * @throws {AppwriteException} * @returns {Promise} */ getBackup(params: { databaseId: string; backupId: string; }): Promise; /** * Get details of a specific database backup including its status, size, and timestamps. * * @param {string} databaseId - Database ID. * @param {string} backupId - Backup ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getBackup(databaseId: string, backupId: string): Promise; /** * Delete a database backup. This will permanently remove the backup from storage and cannot be undone. * * @param {string} params.databaseId - Database ID. * @param {string} params.backupId - Backup ID. * @throws {AppwriteException} * @returns {Promise<{}>} */ deleteBackup(params: { databaseId: string; backupId: string; }): Promise<{}>; /** * Delete a database backup. This will permanently remove the backup from storage and cannot be undone. * * @param {string} databaseId - Database ID. * @param {string} backupId - Backup ID. * @throws {AppwriteException} * @returns {Promise<{}>} * @deprecated Use the object parameter style method for a better developer experience. */ deleteBackup(databaseId: string, backupId: string): Promise<{}>; /** * List all ephemeral branches for a dedicated database. Returns branch metadata including ID, name, namespace, and expiration time. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ listBranches(params: { databaseId: string; }): Promise; /** * List all ephemeral branches for a dedicated database. Returns branch metadata including ID, name, namespace, and expiration time. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listBranches(databaseId: string): Promise; /** * Create an ephemeral database branch from the primary via PVC snapshot. The branch is a full copy of the database at the current point in time, useful for testing schema migrations or running experiments without affecting production data. Branches expire after the configured TTL (default 24 hours). The branch is created asynchronously. * * @param {string} params.databaseId - Database ID. * @param {string} params.branchId - Branch ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {number} params.ttl - Time-to-live in seconds before the branch expires. Min 300 (5 min), max 604800 (7 days). Default: 86400 (24h). * @throws {AppwriteException} * @returns {Promise} */ createBranch(params: { databaseId: string; branchId?: string; ttl?: number; }): Promise; /** * Create an ephemeral database branch from the primary via PVC snapshot. The branch is a full copy of the database at the current point in time, useful for testing schema migrations or running experiments without affecting production data. Branches expire after the configured TTL (default 24 hours). The branch is created asynchronously. * * @param {string} databaseId - Database ID. * @param {string} branchId - Branch ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. * @param {number} ttl - Time-to-live in seconds before the branch expires. Min 300 (5 min), max 604800 (7 days). Default: 86400 (24h). * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createBranch(databaseId: string, branchId?: string, ttl?: number): Promise; /** * Delete an ephemeral database branch. This removes the branch namespace, its PVC, and the associated VolumeSnapshot. The deletion runs asynchronously and is irreversible. * * @param {string} params.databaseId - Database ID. * @param {string} params.branchId - Branch ID. * @throws {AppwriteException} * @returns {Promise} */ deleteBranch(params: { databaseId: string; branchId: string; }): Promise; /** * Delete an ephemeral database branch. This removes the branch namespace, its PVC, and the associated VolumeSnapshot. The deletion runs asynchronously and is irreversible. * * @param {string} databaseId - Database ID. * @param {string} branchId - Branch ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ deleteBranch(databaseId: string, branchId: string): Promise; /** * Queue a rotation of the primary connection credentials for a dedicated database. A hibernated database is woken by the worker before rotation. List database operations until the returned operation reaches a terminal status, then fetch the database again for the refreshed connection string. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ updateCredentials(params: { databaseId: string; }): Promise; /** * Queue a rotation of the primary connection credentials for a dedicated database. A hibernated database is woken by the worker before rotation. List database operations until the returned operation reaches a terminal status, then fetch the database again for the refreshed connection string. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateCredentials(databaseId: string): Promise; /** * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. * * @param {string} params.databaseId - Database ID. * @param {string} params.sql - SQL statement to execute. Exactly one statement per request. * @param {object} params.bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. * @param {number} params.timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. * @throws {AppwriteException} * @returns {Promise} */ createExecution(params: { databaseId: string; sql: string; bindings?: object; timeoutSeconds?: number; }): Promise; /** * Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings. * * @param {string} databaseId - Database ID. * @param {string} sql - SQL statement to execute. Exactly one statement per request. * @param {object} bindings - Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL. * @param {number} timeoutSeconds - Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createExecution(databaseId: string, sql: string, bindings?: object, timeoutSeconds?: number): Promise; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} params.databaseId - Database ID. * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise} */ createFailover(params: { databaseId: string; targetReplicaId?: string; }): Promise; /** * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted. * * @param {string} databaseId - Database ID. * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createFailover(databaseId: string, targetReplicaId?: string): Promise; /** * Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window. * * @param {string} params.databaseId - Database ID. * @param {string} params.day - Day of the week for the maintenance window. Allowed values: sun, mon, tue, wed, thu, fri, sat. * @param {number} params.hourUtc - Hour in UTC (0-23) for maintenance window start. * @throws {AppwriteException} * @returns {Promise} */ updateMaintenance(params: { databaseId: string; day: string; hourUtc: number; }): Promise; /** * Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window. * * @param {string} databaseId - Database ID. * @param {string} day - Day of the week for the maintenance window. Allowed values: sun, mon, tue, wed, thu, fri, sat. * @param {number} hourUtc - Hour in UTC (0-23) for maintenance window start. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updateMaintenance(databaseId: string, day: string, hourUtc: number): Promise; /** * Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover. * * @param {string} params.databaseId - Database ID. * @param {string} params.targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). * @param {string} params.specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise} */ createMigration(params: { databaseId: string; targetType: string; specification?: string; }): Promise; /** * Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover. * * @param {string} databaseId - Database ID. * @param {string} targetType - Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources). * @param {string} specification - Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createMigration(databaseId: string, targetType: string, specification?: string): Promise; /** * List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. * * @param {string} params.databaseId - Database ID. * @param {string} params.status - Filter by operation status. * @param {number} params.limit - Maximum number of operations to return. * @param {number} params.offset - Number of operations to skip. * @throws {AppwriteException} * @returns {Promise} */ listOperations(params: { databaseId: string; status?: string; limit?: number; offset?: number; }): Promise; /** * List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database. * * @param {string} databaseId - Database ID. * @param {string} status - Filter by operation status. * @param {number} limit - Maximum number of operations to return. * @param {number} offset - Number of operations to skip. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listOperations(databaseId: string, status?: string, limit?: number, offset?: number): Promise; /** * Get available point-in-time recovery windows for a dedicated database. Returns the earliest and latest recovery points. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ getPitr(params: { databaseId: string; }): Promise; /** * Get available point-in-time recovery windows for a dedicated database. Returns the earliest and latest recovery points. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getPitr(databaseId: string): Promise; /** * Get the connection pooler configuration for a dedicated database. Returns pooler mode, max connections, and pool size settings. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ getPooler(params: { databaseId: string; }): Promise; /** * Get the connection pooler configuration for a dedicated database. Returns pooler mode, max connections, and pool size settings. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getPooler(databaseId: string): Promise; /** * Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes. * * @param {string} params.databaseId - Database ID. * @param {string} params.mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. * @param {number} params.maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. * @param {number} params.defaultPoolSize - Default pool size per user. * @param {boolean} params.readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled. * @param {string} params.poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). * @param {string} params.poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. * @param {string} params.poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). * @param {string} params.poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. * @throws {AppwriteException} * @returns {Promise} */ updatePooler(params: { databaseId: string; mode?: string; maxConnections?: number; defaultPoolSize?: number; readWriteSplitting?: boolean; poolerCpuRequest?: string; poolerCpuLimit?: string; poolerMemoryRequest?: string; poolerMemoryLimit?: string; }): Promise; /** * Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes. * * @param {string} databaseId - Database ID. * @param {string} mode - Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime. * @param {number} maxConnections - Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead. * @param {number} defaultPoolSize - Default pool size per user. * @param {boolean} readWriteSplitting - Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled. * @param {string} poolerCpuRequest - Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m). * @param {string} poolerCpuLimit - Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod. * @param {string} poolerMemoryRequest - Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi). * @param {string} poolerMemoryLimit - Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ updatePooler(databaseId: string, mode?: string, maxConnections?: number, defaultPoolSize?: number, readWriteSplitting?: boolean, poolerCpuRequest?: string, poolerCpuLimit?: string, poolerMemoryRequest?: string, poolerMemoryLimit?: string): Promise; /** * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ getReplicas(params: { databaseId: string; }): Promise; /** * Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getReplicas(databaseId: string): Promise; /** * List all restorations for a dedicated database. Results can be filtered by status and type. * * @param {string} params.databaseId - Database ID. * @param {string} params.status - Filter by restoration status. * @param {string} params.type - Filter by restoration type. * @param {number} params.limit - Maximum number of restorations to return. * @param {number} params.offset - Number of restorations to skip. * @throws {AppwriteException} * @returns {Promise} */ listRestorations(params: { databaseId: string; status?: string; type?: string; limit?: number; offset?: number; }): Promise; /** * List all restorations for a dedicated database. Results can be filtered by status and type. * * @param {string} databaseId - Database ID. * @param {string} status - Filter by restoration status. * @param {string} type - Filter by restoration type. * @param {number} limit - Maximum number of restorations to return. * @param {number} offset - Number of restorations to skip. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ listRestorations(databaseId: string, status?: string, type?: string, limit?: number, offset?: number): Promise; /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * * @param {string} params.databaseId - Database ID. * @param {string} params.type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. * @param {string} params.backupId - Backup ID to restore from (required for backup type). * @param {string} params.targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. * @param {string} params.targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. * @throws {AppwriteException} * @returns {Promise} */ createRestoration(params: { databaseId: string; type?: string; backupId?: string; targetDatabaseId?: string; targetTime?: string; }): Promise; /** * Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases. * * @param {string} databaseId - Database ID. * @param {string} type - Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery. * @param {string} backupId - Backup ID to restore from (required for backup type). * @param {string} targetDatabaseId - Existing database ID to restore into. The target must be distinct, ready, and use the same engine and version. * @param {string} targetTime - Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createRestoration(databaseId: string, type?: string, backupId?: string, targetDatabaseId?: string, targetTime?: string): Promise; /** * Get details of a specific database restoration including its status, type, and timestamps. * * @param {string} params.databaseId - Database ID. * @param {string} params.restorationId - Restoration ID. * @throws {AppwriteException} * @returns {Promise} */ getRestoration(params: { databaseId: string; restorationId: string; }): Promise; /** * Get details of a specific database restoration including its status, type, and timestamps. * * @param {string} databaseId - Database ID. * @param {string} restorationId - Restoration ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getRestoration(databaseId: string, restorationId: string): Promise; /** * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. * * @param {string} params.databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} */ getStatus(params: { databaseId: string; }): Promise; /** * Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information. * * @param {string} databaseId - Database ID. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ getStatus(databaseId: string): Promise; /** * Upgrade a dedicated database to a new engine version. Uses blue-green deployment for zero-downtime cutover. * * @param {string} params.databaseId - Database ID. * @param {string} params.targetVersion - Target engine version to upgrade to. * @throws {AppwriteException} * @returns {Promise} */ createUpgrade(params: { databaseId: string; targetVersion: string; }): Promise; /** * Upgrade a dedicated database to a new engine version. Uses blue-green deployment for zero-downtime cutover. * * @param {string} databaseId - Database ID. * @param {string} targetVersion - Target engine version to upgrade to. * @throws {AppwriteException} * @returns {Promise} * @deprecated Use the object parameter style method for a better developer experience. */ createUpgrade(databaseId: string, targetVersion: string): Promise; } export { Mysql };