Sha256: 1a75499636188a2257a604ed43572e38ec08699ed85e63dabbf3a2ebef38748f

Contents?: true

Size: 997 Bytes

Versions: 101

Compression:

Stored size: 997 Bytes

Contents

ArJdbc::ConnectionMethods.module_eval do
  def hsqldb_connection(config)
    config[:adapter_spec] ||= ::ArJdbc::HSQLDB
    config[:adapter_class] = ActiveRecord::ConnectionAdapters::HsqldbAdapter unless config.key?(:adapter_class)

    return jndi_connection(config) if jndi_config?(config)

    begin
      require 'jdbc/hsqldb'
      ::Jdbc::HSQLDB.load_driver(:require) if defined?(::Jdbc::HSQLDB.load_driver)
    rescue LoadError # assuming driver.jar is on the class-path
    end

    config[:url] ||= begin
      db = config[:database]
      if db[0, 4] == 'mem:' || db[0, 5] == 'file:' || db[0, 5] == 'hsql:'
        "jdbc:hsqldb:#{db}"
      else
        "jdbc:hsqldb:file:#{db}"
      end
    end
    config[:driver] ||= defined?(::Jdbc::HSQLDB.driver_name) ? ::Jdbc::HSQLDB.driver_name : 'org.hsqldb.jdbcDriver'
    config[:connection_alive_sql] ||= 'CALL PI()' # does not like 'SELECT 1'

    embedded_driver(config)
  end
  alias_method :jdbchsqldb_connection, :hsqldb_connection
end

Version data entries

101 entries across 101 versions & 3 rubygems

Version Path
neo-activerecord-jdbc-adapter-5.0.pre2 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.23 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.22 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-5.0.pre1 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.21 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.20 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.19 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.18 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.17 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.16 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.15 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.14 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.13 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.12 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.11 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.10 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.9 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.8 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.7 lib/arjdbc/hsqldb/connection_methods.rb
activerecord-jdbc-adapter-1.3.6 lib/arjdbc/hsqldb/connection_methods.rb