Cloud Spanner V1 Client - Class Field (1.64.0)

Reference documentation and code samples for the Cloud Spanner V1 Client class Field.

Message representing a single field of a struct.

Generated from protobuf message google.spanner.v1.StructType.Field

Namespace

Google \ Cloud \ Spanner \ V1 \ StructType

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

The name of the field. For reads, this is the column name. For SQL queries, it is the column alias (e.g., "Word" in the query "SELECT 'hello' AS Word"), or the column name (e.g., "ColName" in the query "SELECT ColName FROM Table"). Some columns might have an empty name (e.g., "SELECT UPPER(ColName)"). Note that a query result can contain multiple fields with the same name.

↳ type Google\Cloud\Spanner\V1\Type

The type of the field.

getName

The name of the field. For reads, this is the column name. For SQL queries, it is the column alias (e.g., "Word" in the query "SELECT 'hello' AS Word"), or the column name (e.g., "ColName" in the query "SELECT ColName FROM Table"). Some columns might have an empty name (e.g., "SELECT UPPER(ColName)"). Note that a query result can contain multiple fields with the same name.

Returns
TypeDescription
string

setName

The name of the field. For reads, this is the column name. For SQL queries, it is the column alias (e.g., "Word" in the query "SELECT 'hello' AS Word"), or the column name (e.g., "ColName" in the query "SELECT ColName FROM Table"). Some columns might have an empty name (e.g., "SELECT UPPER(ColName)"). Note that a query result can contain multiple fields with the same name.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getType

The type of the field.

Returns
TypeDescription
Google\Cloud\Spanner\V1\Type|null

hasType

clearType

setType

The type of the field.

Parameter
NameDescription
var Google\Cloud\Spanner\V1\Type
Returns
TypeDescription
$this