activerecord-spanner-adapter - Class ActiveRecord::ConnectionAdapters::SpannerAdapter (v2.0.0)

Reference documentation and code samples for the activerecord-spanner-adapter class ActiveRecord::ConnectionAdapters::SpannerAdapter.

Inherits

  • AbstractAdapter

Methods

.database_exists?

def self.database_exists?(config) -> Boolean

Database

Returns
  • (Boolean)

#active?

def active?() -> Boolean

Connection management

Returns
  • (Boolean)

#arel_visitor

def arel_visitor()

#build_insert_sql

def build_insert_sql(insert)

#current_spanner_transaction

def current_spanner_transaction()

#disconnect!

def disconnect!()

#initialize

def initialize(config_or_deprecated_connection, deprecated_logger = nil, deprecated_connection_options = nil, deprecated_config = nil) -> SpannerAdapter
Returns

#log

def log(sql, name = "SQL", binds = [], type_casted_binds = [], statement_name = nil, *args)

#max_identifier_length

def max_identifier_length()

#native_database_types

def native_database_types()

#next_sequence_value

def next_sequence_value(_sequence_name)

Generate next sequence number for primary key

#prefetch_primary_key?

def prefetch_primary_key?(_table_name = nil) -> Boolean
Returns
  • (Boolean)

#reconnect!

def reconnect!()
Alias Of: #reset!

#reset!

def reset!()
Aliases

#return_value_after_insert?

def return_value_after_insert?(column) -> Boolean
Returns
  • (Boolean)

#spanner_schema_cache

def spanner_schema_cache()

#supports_bulk_alter?

def supports_bulk_alter?() -> Boolean

Supported features

Returns
  • (Boolean)

#supports_check_constraints?

def supports_check_constraints?() -> Boolean
Returns
  • (Boolean)

#supports_common_table_expressions?

def supports_common_table_expressions?() -> Boolean
Returns
  • (Boolean)

#supports_explain?

def supports_explain?() -> Boolean
Returns
  • (Boolean)

#supports_foreign_keys?

def supports_foreign_keys?() -> Boolean
Returns
  • (Boolean)

#supports_index_sort_order?

def supports_index_sort_order?() -> Boolean
Returns
  • (Boolean)

#supports_insert_conflict_target?

def supports_insert_conflict_target?() -> Boolean
Returns
  • (Boolean)

#supports_insert_on_conflict?

def supports_insert_on_conflict?() -> Boolean
Returns
  • (Boolean)

#supports_insert_on_duplicate_skip?

def supports_insert_on_duplicate_skip?() -> Boolean
Returns
  • (Boolean)

#supports_insert_on_duplicate_update?

def supports_insert_on_duplicate_update?() -> Boolean
Returns
  • (Boolean)

#supports_insert_returning?

def supports_insert_returning?() -> Boolean
Returns
  • (Boolean)

#supports_multi_insert?

def supports_multi_insert?() -> Boolean
Returns
  • (Boolean)

#supports_optimizer_hints?

def supports_optimizer_hints?() -> Boolean
Returns
  • (Boolean)

#supports_primary_key?

def supports_primary_key?() -> Boolean
Returns
  • (Boolean)

#supports_virtual_columns?

def supports_virtual_columns?() -> Boolean
Returns
  • (Boolean)

#transform

def transform(sql)

#translate_exception

def translate_exception(exception, message:, sql:, binds:)

Constants

ADAPTER_NAME

value: "spanner".freeze

NATIVE_DATABASE_TYPES

value: { primary_key: "INT64", parent_key: "INT64", string: { name: "STRING", limit: "MAX" }, text: { name: "STRING", limit: "MAX" }, integer: { name: "INT64" }, bigint: { name: "INT64" }, float: { name: "FLOAT64" }, decimal: { name: "NUMERIC" }, numeric: { name: "NUMERIC" }, datetime: { name: "TIMESTAMP" }, time: { name: "TIMESTAMP" }, date: { name: "DATE" }, binary: { name: "BYTES", limit: "MAX" }, boolean: { name: "BOOL" }, json: { name: "JSON" } }.freeze

TYPE_MAP

value: Type::TypeMap.new.tap { |m| initialize_type_map m }