1.8.4 (latest) 1.7.1 1.6.3 1.5.0 1.4.1 1.3.0 1.2.0 1.1.3 1.0.0 0.10.3 0.9.0 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.1 0.1.3 Reference documentation and code samples for the Google Cloud AlloyDB for PostgreSQL V1 Client class ExecuteSqlRequest.

Request for ExecuteSql rpc.

Generated from protobuf message `google.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 from `SELECT 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 from `SELECT 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. |
| `↳ validate_only` | `bool` Optional. If set, validates the sql statement by performing syntax and semantic validation and doesn't execute the query. |

### 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 from `SELECT
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 from `SELECT
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 from
`SELECT 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 from
`SELECT 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` |   |

### getValidateOnly

Optional. If set, validates the sql statement by performing
syntax and semantic validation and doesn't execute the query.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setValidateOnly

Optional. If set, validates the sql statement by performing
syntax and semantic validation and doesn't execute the query.

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

| **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 see AlloyDBAdminClient::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 from `SELECT 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 from `SELECT 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. |
| `password` | `string` Optional. The database native user's password. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-alloydb/latest/V1.ExecuteSqlRequest` |   |