# File lib/arjdbc/h2/adapter.rb, line 75 def self.arel2_visitors(config) visitors = HSQLDB.arel2_visitors(config) visitors.merge({ 'h2' => ::Arel::Visitors::HSQLDB, 'jdbch2' => ::Arel::Visitors::HSQLDB, }) end
# File lib/arjdbc/h2/adapter.rb, line 154 def columns(table_name, name = nil) @connection.columns_internal(table_name.to_s, name, h2_schema) end
# File lib/arjdbc/h2/adapter.rb, line 164 def current_schema execute('CALL SCHEMA()')[0].values[0] end
# File lib/arjdbc/h2/adapter.rb, line 185 def explain(arel, binds = []) sql = "EXPLAIN #{to_sql(arel, binds)}" raw_result = execute(sql, "EXPLAIN", binds) raw_result[0].values.join("\n") # [ "SELECT \n ..." ].to_s end
# File lib/arjdbc/h2/adapter.rb, line 119 def modify_types(types) types end
# File lib/arjdbc/h2/adapter.rb, line 115 def native_database_types NATIVE_DATABASE_TYPES.dup end
EXPLAIN support :
# File lib/arjdbc/h2/adapter.rb, line 183 def supports_explain?; true; end
# File lib/arjdbc/h2/adapter.rb, line 150 def tables @connection.tables(nil, h2_schema) end
# File lib/arjdbc/h2/adapter.rb, line 123 def type_to_sql(type, limit = nil, precision = nil, scale = nil) case type.to_sym when :integer case limit when 1; 'tinyint' when 2; 'smallint' when nil, 3, 4; 'int' when 5..8; 'bigint' else raise(ActiveRecordError, "No integer type has byte size #{limit}") end when :float case limit when 1..4; 'real' when 5..8; 'double' else raise(ActiveRecordError, "No float type has byte size #{limit}") end when :binary if limit && limit < 2 * 1024 * 1024 'binary' else 'blob' end else super end end
Generated with the Darkfish Rdoc Generator 2.