]> source.dussan.org Git - sonarqube.git/blob
f61fcab85ede6258e522e030de46155bef52543e
[sonarqube.git] /
1 require 'arjdbc/hsqldb/adapter'
2
3 module ArJdbc
4   module H2
5     include HSQLDB
6
7     def self.jdbc_connection_class
8       ::ActiveRecord::ConnectionAdapters::H2JdbcConnection
9     end
10
11     def adapter_name #:nodoc:
12       'H2'
13     end
14
15     def arel2_visitors
16       super.merge 'h2' => ::Arel::Visitors::HSQLDB, 'jdbch2' => ::Arel::Visitors::HSQLDB
17     end
18
19     def h2_adapter
20       true
21     end
22
23     def tables
24       @connection.tables(nil, h2_schema)
25     end
26
27     def columns(table_name, name=nil)
28       @connection.columns_internal(table_name.to_s, name, h2_schema)
29     end
30
31     private
32     def h2_schema
33       @config[:schema] || ''
34     end
35   end
36 end