# Class DatabaseAdminConnection (2.47.0-rc)

3.7.0-rc 3.6.0 (latest) 3.5.0 3.4.0 3.3.0 3.2.0 2.48.0-rc 2.47.1 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.0 2.22.1 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.1 2.14.0 2.13.0 2.12.0 2.11.0 A connection to the Cloud Spanner instance administration service.

> [!WARNING]
> **Deprecated:** Please use [`google::cloud::spanner_admin::DatabaseAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/spanner/latest/classgoogle_1_1cloud_1_1spanner__admin_1_1DatabaseAdminClient) and [`google::cloud::spanner_admin::DatabaseAdminConnection`](https://docs.cloud.google.com/cpp/docs/reference/spanner/latest/classgoogle_1_1cloud_1_1spanner__admin_1_1DatabaseAdminConnection) instead.

This interface defines pure-virtual methods for each of the user-facing overload sets in [`DatabaseAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/spanner/latest/classgoogle_1_1cloud_1_1spanner_1_1DatabaseAdminClient). This allows users to inject custom behavior (e.g., with a Google Mock object) in a [`DatabaseAdminClient`](https://docs.cloud.google.com/cpp/docs/reference/spanner/latest/classgoogle_1_1cloud_1_1spanner_1_1DatabaseAdminClient) object for use in their own tests.

To create a concrete instance that connects you to a real Cloud Spanner instance administration service, see [`MakeDatabaseAdminConnection()`](https://docs.cloud.google.com/cpp/docs/reference/spanner/latest/namespacegoogle_1_1cloud_1_1spanner).

## Functions

### virtual options()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Options` |   |

### CreateDatabase(CreateDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.CreateDatabase RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `CreateDatabaseParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `future< StatusOr< google::spanner::admin::database::v1::Database > >` |   |

### GetDatabase(GetDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabase RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `GetDatabaseParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::spanner::admin::database::v1::Database >` |   |

### GetDatabaseDdl(GetDatabaseDdlParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetDatabaseDdl RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `GetDatabaseDdlParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::spanner::admin::database::v1::GetDatabaseDdlResponse >` |   |

### UpdateDatabase(UpdateDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateDatabase RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `UpdateDatabaseParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `future< StatusOr< google::spanner::admin::database::v1::UpdateDatabaseDdlMetadata > >` |   |

### DropDatabase(DropDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `DropDatabaseParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` |   |

### ListDatabases(ListDatabasesParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.DropDatabase RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `ListDatabasesParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListDatabaseRange` |   |

### virtual RestoreDatabase(RestoreDatabaseParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.RestoreDatabase RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `RestoreDatabaseParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `future< StatusOr< google::spanner::admin::database::v1::Database > >` |   |

### GetIamPolicy(GetIamPolicyParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetIamPolicy RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `GetIamPolicyParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` |   |

### SetIamPolicy(SetIamPolicyParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.SetIamPolicy RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `SetIamPolicyParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::Policy >` |   |

### TestIamPermissions(TestIamPermissionsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.TestIamPermissions RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `TestIamPermissionsParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::iam::v1::TestIamPermissionsResponse >` |   |

### virtual CreateBackup(CreateBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.CreateBackup RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `CreateBackupParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `future< StatusOr< google::spanner::admin::database::v1::Backup > >` |   |

### virtual GetBackup(GetBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.GetBackup RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `GetBackupParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::spanner::admin::database::v1::Backup >` |   |

### virtual DeleteBackup(DeleteBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.DeleteBackup RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `DeleteBackupParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Status` |   |

### virtual ListBackups(ListBackupsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackups RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `ListBackupsParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListBackupsRange` |   |

### virtual UpdateBackup(UpdateBackupParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.UpdateBackup RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `UpdateBackupParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `StatusOr< google::spanner::admin::database::v1::Backup >` |   |

### virtual ListBackupOperations(ListBackupOperationsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.ListBackupOperations RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `ListBackupOperationsParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListBackupOperationsRange` |   |

### virtual ListDatabaseOperations(ListDatabaseOperationsParams)

Define the interface for a google.spanner.v1.DatabaseAdmin.ListDatabaseOperations RPC.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
|   | `ListDatabaseOperationsParams` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListDatabaseOperationsRange` |   |