Cloud Spanner V1 Client - Class Field (1.92.1)

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
Name
Description
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
Type
Description
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
Name
Description
var
string
Returns
Type
Description
$this

getType

The type of the field.

Returns
Type
Description

hasType

clearType

setType

The type of the field.

Parameter
Name
Description
Returns
Type
Description
$this
Design a Mobile Site
View Site in Mobile | Classic
Share by: