Class: ActiveRecord::ConnectionAdapters::SpannerSchemaCache

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapters/spanner/schema_cache.rb

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ SpannerSchemaCache

Returns a new instance of SpannerSchemaCache.



10
11
12
13
# File 'lib/active_record/connection_adapters/spanner/schema_cache.rb', line 10

def initialize conn
  @connection = conn
  @primary_and_parent_keys = {}
end

Instance Method Details

#clear!Object



20
21
22
# File 'lib/active_record/connection_adapters/spanner/schema_cache.rb', line 20

def clear!
  @primary_and_parent_keys.clear
end

#primary_and_parent_keys(table_name) ⇒ Object



15
16
17
18
# File 'lib/active_record/connection_adapters/spanner/schema_cache.rb', line 15

def primary_and_parent_keys table_name
  @primary_and_parent_keys[table_name] ||=
    @connection.primary_and_parent_keys table_name
end