Cloud Spanner API - Class Google::Cloud::Spanner::ColumnValue (v2.14.0)

Reference documentation and code samples for the Cloud Spanner API class Google::Cloud::Spanner::ColumnValue.

ColumnValue

Represents a change to be made to a row's column value by the Spanner API.

Inherits

  • Object

Example

require "google/cloud/spanner" spanner = Google::Cloud::Spanner.new db = spanner.client "my-instance", "my-database" # create column value object commit_timestamp = db.commit_timestamp db.commit do |c|  c.insert "users", [  { id: 5, name: "Murphy", updated_at: commit_timestamp }  ] end

Methods

.commit_timestamp

def self.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.

Returns
  • (ColumnValue) — The commit timestamp column value object.
Example
require "google/cloud/spanner" spanner = Google::Cloud::Spanner.new db = spanner.client "my-instance", "my-database" # create column value object commit_timestamp = \  Google::Cloud::Spanner::ColumnValue.commit_timestamp db.commit do |c|  c.insert "users", [  { id: 5, name: "Murphy", updated_at: commit_timestamp }  ] end