Module: ArJdbc

Defined in:
lib/arjdbc/discover.rb,
lib/arjdbc/jdbc.rb,
lib/arjdbc/railtie.rb,
lib/arjdbc/version.rb,
lib/arjdbc/db2/as400.rb,
lib/arjdbc/db2/column.rb,
lib/arjdbc/h2/adapter.rb,
lib/arjdbc/db2/adapter.rb,
lib/arjdbc/abstract/core.rb,
lib/arjdbc/derby/adapter.rb,
lib/arjdbc/hsqldb/adapter.rb,
lib/arjdbc/jdbc/extension.rb,
lib/arjdbc/oracle/adapter.rb,
lib/arjdbc/sybase/adapter.rb,
lib/arjdbc/sqlite3/adapter.rb,
lib/arjdbc/firebird/adapter.rb,
lib/arjdbc/informix/adapter.rb,
lib/arjdbc/postgresql/column.rb,
lib/arjdbc/util/quoted_cache.rb,
lib/arjdbc/util/table_copier.rb,
lib/arjdbc/postgresql/adapter.rb,
lib/arjdbc/postgresql/oid_types.rb,
lib/arjdbc/tasks/database_tasks.rb,
lib/arjdbc/derby/schema_creation.rb,
lib/arjdbc/hsqldb/explain_support.rb,
lib/arjdbc/hsqldb/schema_creation.rb,
lib/arjdbc/jdbc/connection_methods.rb,
lib/arjdbc/tasks/h2_database_tasks.rb,
lib/arjdbc/abstract/statement_cache.rb,
lib/arjdbc/tasks/db2_database_tasks.rb,
lib/arjdbc/tasks/jdbc_database_tasks.rb,
lib/arjdbc/tasks/derby_database_tasks.rb,
lib/arjdbc/tasks/mssql_database_tasks.rb,
lib/arjdbc/util/serialized_attributes.rb,
lib/arjdbc/tasks/hsqldb_database_tasks.rb,
lib/arjdbc/abstract/database_statements.rb,
lib/arjdbc/abstract/transaction_support.rb,
lib/arjdbc/abstract/connection_management.rb

Overview

this file is discovered by the extension mechanism

See Also:

  • {ArJdbc{ArJdbc#discover_extensions}

Defined Under Namespace

Modules: AS400, Abstract, DB2, Derby, Firebird, H2, HSQLDB, Informix, Oracle, PostgreSQL, SQLite3, Sybase, Tasks, Util Classes: Railtie

Constant Summary collapse

VERSION =
'61.2'
JDBC_GEM_ROOT =
File.expand_path("../../../..", __FILE__) + "/"
FireBird =
Firebird
ConnectionMethods =
::ActiveRecord::ConnectionHandling
@@warns =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.deprecate(message, once = nil) ⇒ Object

adds a "DEPRECATION WARNING: " prefix



32
33
34
# File 'lib/arjdbc/jdbc.rb', line 32

def deprecate(message, once = nil) # adds a "DEPRECATION WARNING: " prefix
  ::ActiveSupport::Deprecation.warn(message, caller_locations) || true if warn?(message, once)
end

.extension(name, &block) ⇒ Object

Defines an AR-JDBC extension. An extension consists of a declaration using this method and an ArJdbc::XYZ module that contains implementation and overrides for methods in ActiveRecord::ConnectionAdapters::AbstractAdapter. When you declare your extension, you provide a block that detects when a database configured to use the extension is present and loads the necessary code for it. AR-JDBC will patch the code into the base JdbcAdapter by extending an instance of it with your extension module.

+name+ the name of a module to be defined under the +ArJdbc+ module.

+block+ should be a one- or two-arity block that receives the dialect name or driver class name as the first argument, and optionally the whole database configuration hash as a second argument

Example:

ArJdbc.extension :FRoB do |name| if name =~ /frob/i require 'arjdbc/frob' # contains ArJdbc::FRoB true end end



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/arjdbc/jdbc/extension.rb', line 28

def self.extension(name, &block)
  if const_defined?(name)
    mod = const_get(name)
  else
    mod = const_set(name, Module.new)
  end
  (class << mod; self; end).instance_eval do
    define_method :adapter_matcher do |_name, config|
      if block.arity == 1
        block.call(_name) ? mod : false
      else
        block.call(_name, config) ? mod : false
      end
    end
  end unless mod.respond_to?(:adapter_matcher)
end

.warn(message, once = nil) ⇒ Object



28
29
30
# File 'lib/arjdbc/jdbc.rb', line 28

def warn(message, once = nil)
  super(message) || true if warn?(message, once)
end

Instance Method Details

#schema_creationObject



11
12
13
# File 'lib/arjdbc/derby/schema_creation.rb', line 11

def schema_creation
  SchemaCreation.new self
end