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/types.rb,
lib/arjdbc/mssql/utils.rb,
lib/arjdbc/mssql/column.rb,
lib/arjdbc/abstract/core.rb,
lib/arjdbc/derby/adapter.rb,
lib/arjdbc/mssql/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/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/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

Copyright (c) 2008-2015

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

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

Constant Summary collapse

MsSQL =

compatibility with 1.2

MSSQL
VERSION =
'52.0'
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



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

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



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



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

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