Class: Google::Cloud::Spanner::ColumnValue
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::ColumnValue
- Defined in:
- lib/google/cloud/spanner/column_value.rb
Overview
# ColumnValue
Represents a change to be made to a row’s column value by the Spanner API.
Class Method Summary collapse
-
.commit_timestamp ⇒ ColumnValue
Creates a column value object representing setting a field’s value to the timestamp of the commit.
Instance Method Summary collapse
-
#initialize(type) ⇒ ColumnValue
constructor
fields in document data.
- #to_column_value ⇒ Object
-
#type ⇒ Symbol
The type of change to make to a row’s column value.
Constructor Details
#initialize(type) ⇒ ColumnValue
fields in document data.
45 46 47 |
# File 'lib/google/cloud/spanner/column_value.rb', line 45 def initialize type @type = type end |
Class Method Details
.commit_timestamp ⇒ ColumnValue
Creates a column value object representing setting a field’s value to the timestamp of the commit. (See Google::Cloud::Spanner::Client#commit_timestamp and Transaction#commit_timestamp)
This placeholder value can only be used for timestamp columns that have set the option “(allow_commit_timestamp=true)” in the schema.
102 103 104 |
# File 'lib/google/cloud/spanner/column_value.rb', line 102 def self. new :commit_timestamp end |
Instance Method Details
#to_column_value ⇒ Object
108 109 110 111 |
# File 'lib/google/cloud/spanner/column_value.rb', line 108 def to_column_value # We only have one ColumnValue, so hard-code this for now. "spanner.commit_timestamp()" end |
#type ⇒ Symbol
The type of change to make to a row’s column value.
71 72 73 |
# File 'lib/google/cloud/spanner/column_value.rb', line 71 def type @type end |