In Files

Files

Class/Module Index [+]

Quicksearch

ArJdbc

this file is discovered by the extension mechanism @see {ArJdbc#discover_extensions}

Constants

ConnectionMethods
FireBird
MissingFunctionalityHelper

@private @deprecated backwards compatibility

MsSQL
SerializedAttributesHelper

@private only due backwards compatibility

VERSION

Public Class Methods

deprecate(message, once = nil) click to toggle source
# File lib/arjdbc/jdbc.rb, line 12
def deprecate(message, once = nil)
  ActiveSupport::Deprecation.warn(message, caller) || true if warn?(message, once)
end
extension(name, &block) click to toggle source

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
# 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) click to toggle source
# File lib/arjdbc/jdbc.rb, line 8
def warn(message, once = nil)
  super(message) || true if warn?(message, once)
end

Public Instance Methods

embedded_driver(config) click to toggle source
# File lib/arjdbc/jdbc/connection_methods.rb, line 17
def embedded_driver(config)
  config[:username] ||= "sa"
  config[:password] ||= ""
  jdbc_connection(config)
end
jdbc_connection(config) click to toggle source
# File lib/arjdbc/jdbc/connection_methods.rb, line 9
def jdbc_connection(config)
  adapter_class = config[:adapter_class]
  adapter_class ||= ::ActiveRecord::ConnectionAdapters::JdbcAdapter
  adapter_class.new(nil, logger, config)
end
jndi_config?(config) click to toggle source
# File lib/arjdbc/jdbc/connection_methods.rb, line 25
def jndi_config?(config)
  ::ActiveRecord::ConnectionAdapters::JdbcConnection.jndi_config?(config)
end
jndi_connection(config) click to toggle source
# File lib/arjdbc/jdbc/connection_methods.rb, line 15
def jndi_connection(config); jdbc_connection(config) end
schema_creation() click to toggle source
# File lib/arjdbc/derby/schema_creation.rb, line 11
def schema_creation
  SchemaCreation.new self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.