Reference documentation and code samples for the Google Cloud AlloyDB for PostgreSQL V1 Client class ExecuteSqlRequest.
Request for ExecuteSql rpc.
Generated from protobuf messagegoogle.cloud.alloydb.v1.ExecuteSqlRequest
Namespace
Google \ Cloud \ AlloyDb \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ password
string
Optional. The database native user’s password.
↳ instance
string
Required. The instance where the SQL will be executed. For the required format, see the comment on the Instance.name field.
↳ database
string
Required. Name of the database where the query will be executed. Note - Value provided should be the same as expected fromSELECT current_database();and NOT as a resource reference.
↳ user
string
Required. Database user to be used for executing the SQL. Note - Value provided should be the same as expected fromSELECT current_user;and NOT as a resource reference.
↳ sql_statement
string
Required. SQL statement to execute on database. Any valid statement is permitted, including DDL, DML, DQL statements.
getPassword
Optional. The database native user’s password.
Returns
Type
Description
string
hasPassword
setPassword
Optional. The database native user’s password.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getInstance
Required. The instance where the SQL will be executed. For the required
format, see the comment on the Instance.name field.
Returns
Type
Description
string
setInstance
Required. The instance where the SQL will be executed. For the required
format, see the comment on the Instance.name field.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDatabase
Required. Name of the database where the query will be executed.
Note - Value provided should be the same as expected fromSELECT
current_database();and NOT as a resource reference.
Returns
Type
Description
string
setDatabase
Required. Name of the database where the query will be executed.
Note - Value provided should be the same as expected fromSELECT
current_database();and NOT as a resource reference.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getUser
Required. Database user to be used for executing the SQL.
Note - Value provided should be the same as expected fromSELECT current_user;and NOT as a resource reference.
Returns
Type
Description
string
setUser
Required. Database user to be used for executing the SQL.
Note - Value provided should be the same as expected fromSELECT current_user;and NOT as a resource reference.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSqlStatement
Required. SQL statement to execute on database. Any valid statement is
permitted, including DDL, DML, DQL statements.
Returns
Type
Description
string
setSqlStatement
Required. SQL statement to execute on database. Any valid statement is
permitted, including DDL, DML, DQL statements.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getUserCredential
Returns
Type
Description
string
static::build
Parameters
Name
Description
instance
string
Required. The instance where the SQL will be executed. For the required
format, see the comment on the Instance.name field. Please seeAlloyDBAdminClient::instanceName()for help formatting this field.
database
string
Required. Name of the database where the query will be executed.
Note - Value provided should be the same as expected fromSELECT
current_database();and NOT as a resource reference.
user
string
Required. Database user to be used for executing the SQL.
Note - Value provided should be the same as expected fromSELECT current_user;and NOT as a resource reference.
sqlStatement
string
Required. SQL statement to execute on database. Any valid statement is
permitted, including DDL, DML, DQL statements.
[[["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 AlloyDB for PostgreSQL V1 Client - Class ExecuteSqlRequest (1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/php/docs/reference/cloud-alloydb/latest/V1.ExecuteSqlRequest)\n- [1.4.0](/php/docs/reference/cloud-alloydb/1.4.0/V1.ExecuteSqlRequest)\n- [1.3.0](/php/docs/reference/cloud-alloydb/1.3.0/V1.ExecuteSqlRequest)\n- [1.2.0](/php/docs/reference/cloud-alloydb/1.2.0/V1.ExecuteSqlRequest)\n- [1.1.3](/php/docs/reference/cloud-alloydb/1.1.3/V1.ExecuteSqlRequest)\n- [1.0.0](/php/docs/reference/cloud-alloydb/1.0.0/V1.ExecuteSqlRequest)\n- [0.10.3](/php/docs/reference/cloud-alloydb/0.10.3/V1.ExecuteSqlRequest)\n- [0.9.0](/php/docs/reference/cloud-alloydb/0.9.0/V1.ExecuteSqlRequest)\n- [0.8.0](/php/docs/reference/cloud-alloydb/0.8.0/V1.ExecuteSqlRequest)\n- [0.7.1](/php/docs/reference/cloud-alloydb/0.7.1/V1.ExecuteSqlRequest)\n- [0.6.0](/php/docs/reference/cloud-alloydb/0.6.0/V1.ExecuteSqlRequest)\n- [0.5.0](/php/docs/reference/cloud-alloydb/0.5.0/V1.ExecuteSqlRequest)\n- [0.4.0](/php/docs/reference/cloud-alloydb/0.4.0/V1.ExecuteSqlRequest)\n- [0.3.0](/php/docs/reference/cloud-alloydb/0.3.0/V1.ExecuteSqlRequest)\n- [0.2.1](/php/docs/reference/cloud-alloydb/0.2.1/V1.ExecuteSqlRequest)\n- [0.1.3](/php/docs/reference/cloud-alloydb/0.1.3/V1.ExecuteSqlRequest) \nReference documentation and code samples for the Google Cloud AlloyDB for PostgreSQL V1 Client class ExecuteSqlRequest.\n\nRequest for ExecuteSql rpc.\n\nGenerated from protobuf message `google.cloud.alloydb.v1.ExecuteSqlRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ AlloyDb \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getPassword\n\nOptional. The database native user's password.\n\n### hasPassword\n\n### setPassword\n\nOptional. The database native user's password.\n\n### getInstance\n\nRequired. The instance where the SQL will be executed. For the required\nformat, see the comment on the Instance.name field.\n\n### setInstance\n\nRequired. The instance where the SQL will be executed. For the required\nformat, see the comment on the Instance.name field.\n\n### getDatabase\n\nRequired. Name of the database where the query will be executed.\n\nNote - Value provided should be the same as expected from `SELECT\ncurrent_database();` and NOT as a resource reference.\n\n### setDatabase\n\nRequired. Name of the database where the query will be executed.\n\nNote - Value provided should be the same as expected from `SELECT\ncurrent_database();` and NOT as a resource reference.\n\n### getUser\n\nRequired. Database user to be used for executing the SQL.\n\nNote - Value provided should be the same as expected from\n`SELECT current_user;` and NOT as a resource reference.\n\n### setUser\n\nRequired. Database user to be used for executing the SQL.\n\nNote - Value provided should be the same as expected from\n`SELECT current_user;` and NOT as a resource reference.\n\n### getSqlStatement\n\nRequired. SQL statement to execute on database. Any valid statement is\npermitted, including DDL, DML, DQL statements.\n\n### setSqlStatement\n\nRequired. SQL statement to execute on database. Any valid statement is\npermitted, including DDL, DML, DQL statements.\n\n### getUserCredential\n\n### static::build"]]