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 \ StructTypeMethods
__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., |
↳ 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 |
Google\Cloud\Spanner\V1\Type|null |
hasType
clearType
setType
The type of the field.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Spanner\V1\Type
|
Returns | |
---|---|
Type | Description |
$this |