Reference documentation and code samples for the activerecord-spanner-adapter class ActiveRecord::ConnectionAdapters::SpannerAdapter.
Inherits
- AbstractAdapter
Includes
Methods
.database_exists?
def self.database_exists?(config) -> Boolean
Database
- (Boolean)
#active?
def active?() -> Boolean
Connection management
- (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
- (SpannerAdapter) — a new instance of SpannerAdapter
#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
- (Boolean)
#reconnect!
def reconnect!()
#reset!
def reset!()
#return_value_after_insert?
def return_value_after_insert?(column) -> Boolean
- (Boolean)
#spanner_schema_cache
def spanner_schema_cache()
#supports_bulk_alter?
def supports_bulk_alter?() -> Boolean
Supported features
- (Boolean)
#supports_check_constraints?
def supports_check_constraints?() -> Boolean
- (Boolean)
#supports_common_table_expressions?
def supports_common_table_expressions?() -> Boolean
- (Boolean)
#supports_explain?
def supports_explain?() -> Boolean
- (Boolean)
#supports_foreign_keys?
def supports_foreign_keys?() -> Boolean
- (Boolean)
#supports_index_sort_order?
def supports_index_sort_order?() -> Boolean
- (Boolean)
#supports_insert_conflict_target?
def supports_insert_conflict_target?() -> Boolean
- (Boolean)
#supports_insert_on_conflict?
def supports_insert_on_conflict?() -> Boolean
- (Boolean)
#supports_insert_on_duplicate_skip?
def supports_insert_on_duplicate_skip?() -> Boolean
- (Boolean)
#supports_insert_on_duplicate_update?
def supports_insert_on_duplicate_update?() -> Boolean
- (Boolean)
#supports_insert_returning?
def supports_insert_returning?() -> Boolean
- (Boolean)
#supports_multi_insert?
def supports_multi_insert?() -> Boolean
- (Boolean)
#supports_optimizer_hints?
def supports_optimizer_hints?() -> Boolean
- (Boolean)
#supports_primary_key?
def supports_primary_key?() -> Boolean
- (Boolean)
#supports_virtual_columns?
def supports_virtual_columns?() -> Boolean
- (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 }