Module: ArJdbc

Defined in:
lib/arjdbc/discover.rb,
lib/arjdbc/jdbc.rb,
lib/arjdbc/mssql.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/mssql/utils.rb,
lib/arjdbc/mssql/column.rb,
lib/arjdbc/mysql/column.rb,
lib/arjdbc/derby/adapter.rb,
lib/arjdbc/mimer/adapter.rb,
lib/arjdbc/mssql/adapter.rb,
lib/arjdbc/mysql/adapter.rb,
lib/arjdbc/oracle/column.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/mssql/lock_methods.rb,
lib/arjdbc/postgresql/adapter.rb,
lib/arjdbc/mssql/limit_helpers.rb,
lib/arjdbc/postgresql/oid_types.rb,
lib/arjdbc/tasks/database_tasks.rb,
lib/arjdbc/derby/schema_creation.rb,
lib/arjdbc/mssql/explain_support.rb,
lib/arjdbc/mysql/explain_support.rb,
lib/arjdbc/mysql/schema_creation.rb,
lib/arjdbc/hsqldb/explain_support.rb,
lib/arjdbc/hsqldb/schema_creation.rb,
lib/arjdbc/jdbc/connection_methods.rb,
lib/arjdbc/jdbc/quoted_primary_key.rb,
lib/arjdbc/mysql/bulk_change_table.rb,
lib/arjdbc/sqlite3/explain_support.rb,
lib/arjdbc/tasks/h2_database_tasks.rb,
lib/arjdbc/tasks/db2_database_tasks.rb,
lib/arjdbc/tasks/jdbc_database_tasks.rb,
lib/arjdbc/postgresql/explain_support.rb,
lib/arjdbc/postgresql/schema_creation.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/tasks/oracle_database_tasks.rb

Overview

this file is discovered by the extension mechanism

See Also:

  • {ArJdbc{ArJdbc#discover_extensions}

Defined Under Namespace

Modules: AS400, DB2, Derby, Firebird, H2, HSQLDB, Informix, MSSQL, Mimer, MySQL, Oracle, PostgreSQL, QuotedPrimaryKeyExtension, SQLite3, Sybase, Tasks, Util, Version Classes: Railtie

Constant Summary collapse

MsSQL =

compatibility with 1.2

MSSQL
VERSION =
"1.3.16"
FireBird =
Firebird
ConnectionMethods =

3.x

(class << ActiveRecord::Base; self; end)
@@warns =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.deprecate(message, once = nil) ⇒ Object

adds a "DEPRECATION WARNING: " prefix



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

def deprecate(message, once = nil) # adds a "DEPRECATION WARNING: " prefix
  ::ActiveSupport::Deprecation.warn(message, caller) || 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



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

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



7
8
9
# File 'lib/arjdbc/jdbc.rb', line 7

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