# Google Cloud Security Command Center V1 Client - Class Database (2.5.1)

2.5.1 (latest) 2.5.0 2.4.2 2.3.0 2.2.1 2.1.1 2.0.4 1.32.0 1.31.0 1.30.0 1.29.0 1.28.2 1.21.0 1.20.2 1.19.1 1.18.0 1.17.0 1.16.0 1.15.1 1.14.2 1.13.1 Reference documentation and code samples for the Google Cloud Security Command Center V1 Client class Database.

Represents database access information, such as queries. A database may be a
sub-resource of an instance (as in the case of Cloud SQL instances or Cloud
Spanner instances), or the database instance itself. Some database resources
might not have the [full resource
name](https://google.aip.dev/122#full-resource-names) populated because these
resource types, such as Cloud SQL databases, are not yet supported by Cloud
Asset Inventory. In these cases only the display name is provided.

Generated from protobuf message `google.cloud.securitycenter.v1.Database`

## Namespace

Google \\ Cloud \\ SecurityCenter \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Some database resources may not have the [full resource name](https://google.aip.dev/122#full-resource-names) populated because these resource types are not yet supported by Cloud Asset Inventory (e.g. Cloud SQL databases). In these cases only the display name will be provided. The [full resource name](https://google.aip.dev/122#full-resource-names) of the database that the user connected to, if it is supported by Cloud Asset Inventory. |
| `↳ display_name` | `string` The human-readable name of the database that the user connected to. |
| `↳ user_name` | `string` The username used to connect to the database. The username might not be an IAM principal and does not have a set format. |
| `↳ query` | `string` The SQL statement that is associated with the database access. |
| `↳ grantees` | `string[]` The target usernames, roles, or groups of an SQL privilege grant, which is not an IAM policy change. |
| `↳ version` | `string` The version of the database, for example, POSTGRES_14. See [the complete list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion). |

### getName

Some database resources may not have the [full resource
name](https://google.aip.dev/122#full-resource-names) populated because
these resource types are not yet supported by Cloud Asset Inventory (e.g.

Cloud SQL databases). In these cases only the display name will be
provided.
The [full resource name](https://google.aip.dev/122#full-resource-names) of
the database that the user connected to, if it is supported by Cloud Asset
Inventory.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Some database resources may not have the [full resource
name](https://google.aip.dev/122#full-resource-names) populated because
these resource types are not yet supported by Cloud Asset Inventory (e.g.

Cloud SQL databases). In these cases only the display name will be
provided.
The [full resource name](https://google.aip.dev/122#full-resource-names) of
the database that the user connected to, if it is supported by Cloud Asset
Inventory.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisplayName

The human-readable name of the database that the user connected to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

The human-readable name of the database that the user connected to.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUserName

The username used to connect to the database. The username might not be an
IAM principal and does not have a set format.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setUserName

The username used to connect to the database. The username might not be an
IAM principal and does not have a set format.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQuery

The SQL statement that is associated with the database access.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setQuery

The SQL statement that is associated with the database access.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGrantees

The target usernames, roles, or groups of an SQL privilege grant, which is
not an IAM policy change.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setGrantees

The target usernames, roles, or groups of an SQL privilege grant, which is
not an IAM policy change.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getVersion

The version of the database, for example, POSTGRES_14.

See [the complete
list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setVersion

The version of the database, for example, POSTGRES_14.

See [the complete
list](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |