Class: ActiveRecord::ConnectionAdapters::BoundSchemaReflection

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

Defined Under Namespace

Classes: FakePool

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(abstract_schema_reflection, pool) ⇒ BoundSchemaReflection

Returns a new instance of BoundSchemaReflection.



160
161
162
163
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 160

def initialize(abstract_schema_reflection, pool)
  @schema_reflection = abstract_schema_reflection
  @pool = pool
end

Class Method Details

.for_lone_connection(abstract_schema_reflection, connection) ⇒ Object

:nodoc:



155
156
157
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 155

def for_lone_connection(abstract_schema_reflection, connection) # :nodoc:
  new(abstract_schema_reflection, FakePool.new(connection))
end

Instance Method Details

#add(name) ⇒ Object



185
186
187
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 185

def add(name)
  @schema_reflection.add(@pool, name)
end

#cached?(table_name) ⇒ Boolean

Returns:

  • (Boolean)


173
174
175
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 173

def cached?(table_name)
  @schema_reflection.cached?(table_name)
end

#clear!Object



165
166
167
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 165

def clear!
  @schema_reflection.clear!
end

#clear_data_source_cache!(name) ⇒ Object



217
218
219
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 217

def clear_data_source_cache!(name)
  @schema_reflection.clear_data_source_cache!(@pool, name)
end

#columns(table_name) ⇒ Object



193
194
195
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 193

def columns(table_name)
  @schema_reflection.columns(@pool, table_name)
end

#columns_hash(table_name) ⇒ Object



197
198
199
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 197

def columns_hash(table_name)
  @schema_reflection.columns_hash(@pool, table_name)
end

#columns_hash?(table_name) ⇒ Boolean

Returns:

  • (Boolean)


201
202
203
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 201

def columns_hash?(table_name)
  @schema_reflection.columns_hash?(@pool, table_name)
end

#data_source_exists?(name) ⇒ Boolean

Returns:

  • (Boolean)


181
182
183
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 181

def data_source_exists?(name)
  @schema_reflection.data_source_exists?(@pool, name)
end

#data_sources(name) ⇒ Object



189
190
191
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 189

def data_sources(name)
  @schema_reflection.data_sources(@pool, name)
end

#dump_to(filename) ⇒ Object



221
222
223
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 221

def dump_to(filename)
  @schema_reflection.dump_to(@pool, filename)
end

#indexes(table_name) ⇒ Object



205
206
207
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 205

def indexes(table_name)
  @schema_reflection.indexes(@pool, table_name)
end

#load!Object



169
170
171
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 169

def load!
  @schema_reflection.load!(@pool)
end

#primary_keys(table_name) ⇒ Object



177
178
179
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 177

def primary_keys(table_name)
  @schema_reflection.primary_keys(@pool, table_name)
end

#sizeObject



213
214
215
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 213

def size
  @schema_reflection.size(@pool)
end

#versionObject



209
210
211
# File 'lib/active_record/connection_adapters/schema_cache.rb', line 209

def version
  @schema_reflection.version(@pool)
end