Reference documentation and code samples for the Google Cloud Security Command Center V2 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 thefull resource
namepopulated 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 messagegoogle.cloud.securitycenter.v2.Database
Namespace
Google \ Cloud \ SecurityCenter \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Some database resources may not have thefull resource namepopulated 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. Thefull resource nameof 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
array
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. Seethe complete list.
getName
Some database resources may not have thefull resource
namepopulated 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.
Thefull resource nameof
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 thefull resource
namepopulated 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.
Thefull resource nameof
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Security Command Center V2 Client - Class Database (2.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.2.1 (latest)](/php/docs/reference/cloud-security-center/latest/V2.Database)\n- [2.2.0](/php/docs/reference/cloud-security-center/2.2.0/V2.Database)\n- [2.1.1](/php/docs/reference/cloud-security-center/2.1.1/V2.Database)\n- [2.0.4](/php/docs/reference/cloud-security-center/2.0.4/V2.Database)\n- [1.32.0](/php/docs/reference/cloud-security-center/1.32.0/V2.Database)\n- [1.31.0](/php/docs/reference/cloud-security-center/1.31.0/V2.Database)\n- [1.30.0](/php/docs/reference/cloud-security-center/1.30.0/V2.Database)\n- [1.29.0](/php/docs/reference/cloud-security-center/1.29.0/V2.Database)\n- [1.28.2](/php/docs/reference/cloud-security-center/1.28.2/V2.Database)\n- [1.21.0](/php/docs/reference/cloud-security-center/1.21.0/V2.Database)\n- [1.20.2](/php/docs/reference/cloud-security-center/1.20.2/V2.Database)\n- [1.19.1](/php/docs/reference/cloud-security-center/1.19.1/V2.Database)\n- [1.18.0](/php/docs/reference/cloud-security-center/1.18.0/V2.Database)\n- [1.17.0](/php/docs/reference/cloud-security-center/1.17.0/V2.Database)\n- [1.16.0](/php/docs/reference/cloud-security-center/1.16.0/V2.Database)\n- [1.15.1](/php/docs/reference/cloud-security-center/1.15.1/V2.Database)\n- [1.14.2](/php/docs/reference/cloud-security-center/1.14.2/V2.Database)\n- [1.13.1](/php/docs/reference/cloud-security-center/1.13.1/V2.Database) \nReference documentation and code samples for the Google Cloud Security Command Center V2 Client class Database.\n\nRepresents database access information, such as queries. A database may be a\nsub-resource of an instance (as in the case of Cloud SQL instances or Cloud\nSpanner instances), or the database instance itself. Some database resources\nmight not have the [full resource\nname](https://google.aip.dev/122#full-resource-names) populated because these\nresource types, such as Cloud SQL databases, are not yet supported by Cloud\nAsset Inventory. In these cases only the display name is provided.\n\nGenerated from protobuf message `google.cloud.securitycenter.v2.Database`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ SecurityCenter \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nSome database resources may not have the [full resource\nname](https://google.aip.dev/122#full-resource-names) populated because\nthese resource types are not yet supported by Cloud Asset Inventory (e.g.\n\nCloud SQL databases). In these cases only the display name will be\nprovided.\nThe [full resource name](https://google.aip.dev/122#full-resource-names) of\nthe database that the user connected to, if it is supported by Cloud Asset\nInventory.\n\n### setName\n\nSome database resources may not have the [full resource\nname](https://google.aip.dev/122#full-resource-names) populated because\nthese resource types are not yet supported by Cloud Asset Inventory (e.g.\n\nCloud SQL databases). In these cases only the display name will be\nprovided.\nThe [full resource name](https://google.aip.dev/122#full-resource-names) of\nthe database that the user connected to, if it is supported by Cloud Asset\nInventory.\n\n### getDisplayName\n\nThe human-readable name of the database that the user connected to.\n\n### setDisplayName\n\nThe human-readable name of the database that the user connected to.\n\n### getUserName\n\nThe username used to connect to the database. The username might not be an\nIAM principal and does not have a set format.\n\n### setUserName\n\nThe username used to connect to the database. The username might not be an\nIAM principal and does not have a set format.\n\n### getQuery\n\nThe SQL statement that is associated with the database access.\n\n### setQuery\n\nThe SQL statement that is associated with the database access.\n\n### getGrantees\n\nThe target usernames, roles, or groups of an SQL privilege grant, which is\nnot an IAM policy change.\n\n### setGrantees\n\nThe target usernames, roles, or groups of an SQL privilege grant, which is\nnot an IAM policy change.\n\n### getVersion\n\nThe version of the database, for example, POSTGRES_14.\n\nSee [the complete\nlist](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion).\n\n### setVersion\n\nThe version of the database, for example, POSTGRES_14.\n\nSee [the complete\nlist](https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1/SqlDatabaseVersion)."]]