class ExecuteSqlRequest extends Message

The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql].

Protobuf type Google\Spanner\V1\ExecuteSqlRequest

Methods

__construct()

No description

string
getSession()

Required. The session in which the SQL query should be performed.

setSession(string $var)

Required. The session in which the SQL query should be performed.

getTransaction()

The transaction to use. If none is provided, the default is a temporary read-only transaction with strong concurrency.

setTransaction(TransactionSelector $var)

The transaction to use. If none is provided, the default is a temporary read-only transaction with strong concurrency.

string
getSql()

Required. The SQL query string.

setSql(string $var)

Required. The SQL query string.

getParams()

The SQL query string can contain parameter placeholders. A parameter placeholder consists of '@' followed by the parameter name. Parameter names consist of any combination of letters, numbers, and underscores.

setParams(Struct $var)

The SQL query string can contain parameter placeholders. A parameter placeholder consists of '@' followed by the parameter name. Parameter names consist of any combination of letters, numbers, and underscores.

RepeatedField
getParamTypes()

It is not always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type BYTES and values of type STRING both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings.

setParamTypes(array|RepeatedField $var)

It is not always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type BYTES and values of type STRING both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings.

string
getResumeToken()

If this request is resuming a previously interrupted SQL query execution, resume_token should be copied from the last [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this enables the new SQL query execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.

setResumeToken(string $var)

If this request is resuming a previously interrupted SQL query execution, resume_token should be copied from the last [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this enables the new SQL query execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.

int
getQueryMode()

Used to control the amount of debugging information returned in [ResultSetStats][google.spanner.v1.ResultSetStats].

setQueryMode(int $var)

Used to control the amount of debugging information returned in [ResultSetStats][google.spanner.v1.ResultSetStats].

Details

at line 85
__construct()

at line 96
string getSession()

Required. The session in which the SQL query should be performed.

Generated from protobuf field string session = 1;

Return Value

string

at line 107
setSession(string $var)

Required. The session in which the SQL query should be performed.

Generated from protobuf field string session = 1;

Parameters

string $var

at line 120
TransactionSelector getTransaction()

The transaction to use. If none is provided, the default is a temporary read-only transaction with strong concurrency.

Generated from protobuf field .google.spanner.v1.TransactionSelector transaction = 2;

Return Value

TransactionSelector

at line 132
setTransaction(TransactionSelector $var)

The transaction to use. If none is provided, the default is a temporary read-only transaction with strong concurrency.

Generated from protobuf field .google.spanner.v1.TransactionSelector transaction = 2;

Parameters

TransactionSelector $var

at line 144
string getSql()

Required. The SQL query string.

Generated from protobuf field string sql = 3;

Return Value

string

at line 155
setSql(string $var)

Required. The SQL query string.

Generated from protobuf field string sql = 3;

Parameters

string $var

at line 177
Struct getParams()

The SQL query string can contain parameter placeholders. A parameter placeholder consists of '@' followed by the parameter name. Parameter names consist of any combination of letters, numbers, and underscores.

Parameters can appear anywhere that a literal value is expected. The same parameter name can be used more than once, for example: "WHERE id > &#64;msg_id AND id < &#64;msg_id + 100" It is an error to execute an SQL query with unbound parameters. Parameter values are specified using params, which is a JSON object whose keys are parameter names, and whose values are the corresponding parameter values.

Generated from protobuf field .google.protobuf.Struct params = 4;

Return Value

Struct

at line 198
setParams(Struct $var)

The SQL query string can contain parameter placeholders. A parameter placeholder consists of '&#64;' followed by the parameter name. Parameter names consist of any combination of letters, numbers, and underscores.

Parameters can appear anywhere that a literal value is expected. The same parameter name can be used more than once, for example: "WHERE id > &#64;msg_id AND id < &#64;msg_id + 100" It is an error to execute an SQL query with unbound parameters. Parameter values are specified using params, which is a JSON object whose keys are parameter names, and whose values are the corresponding parameter values.

Generated from protobuf field .google.protobuf.Struct params = 4;

Parameters

Struct $var

at line 216
RepeatedField getParamTypes()

It is not always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type BYTES and values of type STRING both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings.

In these cases, param_types can be used to specify the exact SQL type for some or all of the SQL query parameters. See the definition of [Type][google.spanner.v1.Type] for more information about SQL types.

Generated from protobuf field map<string, .google.spanner.v1.Type> param_types = 5;

Return Value

RepeatedField

at line 233
setParamTypes(array|RepeatedField $var)

It is not always possible for Cloud Spanner to infer the right SQL type from a JSON value. For example, values of type BYTES and values of type STRING both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings.

In these cases, param_types can be used to specify the exact SQL type for some or all of the SQL query parameters. See the definition of [Type][google.spanner.v1.Type] for more information about SQL types.

Generated from protobuf field map<string, .google.spanner.v1.Type> param_types = 5;

Parameters

array|RepeatedField $var

at line 250
string getResumeToken()

If this request is resuming a previously interrupted SQL query execution, resume_token should be copied from the last [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this enables the new SQL query execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.

Generated from protobuf field bytes resume_token = 6;

Return Value

string

at line 266
setResumeToken(string $var)

If this request is resuming a previously interrupted SQL query execution, resume_token should be copied from the last [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this enables the new SQL query execution to resume where the last one left off. The rest of the request parameters must exactly match the request that yielded this token.

Generated from protobuf field bytes resume_token = 6;

Parameters

string $var

at line 279
int getQueryMode()

Used to control the amount of debugging information returned in [ResultSetStats][google.spanner.v1.ResultSetStats].

Generated from protobuf field .google.spanner.v1.ExecuteSqlRequest.QueryMode query_mode = 7;

Return Value

int

at line 291
setQueryMode(int $var)

Used to control the amount of debugging information returned in [ResultSetStats][google.spanner.v1.ResultSetStats].

Generated from protobuf field .google.spanner.v1.ExecuteSqlRequest.QueryMode query_mode = 7;

Parameters

int $var