2.2.0 (latest) 2.0.6 1.34.2 1.33.1 1.32.3 1.31.0 1.30.0 1.29.2 1.28.2 1.26.0 1.25.0 1.24.4 1.23.0 1.22.1 1.21.2 1.19.0 1.18.1 1.17.1 Reference documentation and code samples for the Cloud Datastore V1 Client class GqlQuery.

A [GQL
query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).

Generated from protobuf message `google.datastore.v1.GqlQuery`

## Namespace

Google \\ Cloud \\ Datastore \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ query_string` | `string` A string of the format described [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). |
| `↳ allow_literals` | `bool` When false, the query string must not contain any literals and instead must bind all values. For example, `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while `SELECT * FROM Kind WHERE a = \@value` is. |
| `↳ named_bindings` | `array|Google\Protobuf\Internal\MapField` For each non-reserved named binding site in the query string, there must be a named parameter with that name, but not necessarily the inverse. Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex `__.*__`, and must not be `""`. |
| `↳ positional_bindings` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.GqlQueryParameter>` Numbered binding site @1 references the first numbered parameter, effectively using 1-based indexing, rather than the usual 0. For each binding site numbered i in `query_string`, there must be an i-th numbered parameter. The inverse must also be true. |

### getQueryString

A string of the format described
[here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).

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

### setQueryString

A string of the format described
[here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference).

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

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

### getAllowLiterals

When false, the query string must not contain any literals and instead must
bind all values. For example,
`SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while
`SELECT * FROM Kind WHERE a = \@value` is.

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

### setAllowLiterals

When false, the query string must not contain any literals and instead must
bind all values. For example,
`SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while
`SELECT * FROM Kind WHERE a = \@value` is.

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

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

### getNamedBindings

For each non-reserved named binding site in the query string, there must be
a named parameter with that name, but not necessarily the inverse.

Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex
`__.*__`, and must not be `""`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Internal\MapField` |   |

### setNamedBindings

For each non-reserved named binding site in the query string, there must be
a named parameter with that name, but not necessarily the inverse.

Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex
`__.*__`, and must not be `""`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|Google\Protobuf\Internal\MapField` |

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

### getPositionalBindings

Numbered binding site @1 references the first numbered parameter,
effectively using 1-based indexing, rather than the usual 0.

For each binding site numbered i in `query_string`, there must be an i-th
numbered parameter. The inverse must also be true.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.GqlQueryParameter>` |   |

### setPositionalBindings

Numbered binding site @1 references the first numbered parameter,
effectively using 1-based indexing, rather than the usual 0.

For each binding site numbered i in `query_string`, there must be an i-th
numbered parameter. The inverse must also be true.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-datastore/latest/V1.GqlQueryParameter>` |

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