Module: TableSaw

Defined in:
lib/table_saw.rb,
lib/table_saw/version.rb,
lib/table_saw/manifest.rb,
lib/table_saw/foreign_key.rb,
lib/table_saw/associations.rb,
lib/table_saw/formats/base.rb,
lib/table_saw/formats/copy.rb,
lib/table_saw/configuration.rb,
lib/table_saw/formats/insert.rb,
lib/table_saw/create_dump_file.rb,
lib/table_saw/information_schema.rb,
lib/table_saw/dependency_graph/build.rb,
lib/table_saw/variable_interpolation.rb,
lib/table_saw/queries/serial_sequences.rb,
lib/table_saw/queries/materialized_views.rb,
lib/table_saw/dependency_graph/dump_table.rb,
lib/table_saw/dependency_graph/add_directive.rb,
lib/table_saw/queries/serialize_sql_in_clause.rb,
lib/table_saw/queries/execute_insert_statement.rb,
lib/table_saw/queries/foreign_key_relationships.rb,
lib/table_saw/queries/prepared_insert_statement.rb,
lib/table_saw/dependency_graph/has_many_directives.rb,
lib/table_saw/dependency_graph/build_has_many_query.rb,
lib/table_saw/dependency_graph/belongs_to_directives.rb

Defined Under Namespace

Modules: DependencyGraph, Formats, Queries Classes: Associations, Configuration, CreateDumpFile, ForeignKey, InformationSchema, Manifest, VariableInterpolation

Constant Summary collapse

VERSION =
'3.2.0'

Class Method Summary collapse

Class Method Details

.configurationObject



15
16
17
# File 'lib/table_saw.rb', line 15

def self.configuration
  @configuration ||= TableSaw::Configuration.new
end

.configure(args = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/table_saw.rb', line 19

def self.configure(args = {})
  if block_given?
    yield configuration
  else
    args.each do |key, value|
      configuration.public_send("#{key}=", value)
    end
  end
end

.connectionObject

:nocov:



42
43
44
45
46
47
48
# File 'lib/table_saw.rb', line 42

def self.connection
  if ActiveRecord.gem_version < Gem::Version.new('7.2.0')
    connection_pool.connection
  else
    connection_pool.lease_connection
  end
end

.connection_poolObject



37
38
39
# File 'lib/table_saw.rb', line 37

def self.connection_pool
  ActiveRecord::Base.connection_pool
end

.information_schemaObject



29
30
31
# File 'lib/table_saw.rb', line 29

def self.information_schema
  @information_schema ||= TableSaw::InformationSchema.new
end

.schema_cacheObject



33
34
35
# File 'lib/table_saw.rb', line 33

def self.schema_cache
  connection.schema_cache
end