Module: ADBC::ConnectionOperations

Included in:
Connection, ADBCArrow::Connection
Defined in:
lib/adbc/connection-operations.rb

Instance Method Summary collapse

Instance Method Details

#info(codes = nil) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/adbc/connection-operations.rb', line 32

def info(codes=nil)
  unless codes.nil?
    codes = codes.collect do |code|
      ADBC::Info.try_convert(code)
    end
  end
  get_info(codes) do |table|
    values = {}
    table.raw_records.each do |code, value|
      value = value.values[0] if value.is_a?(Hash)
      code = ADBC::Info.try_convert(code)
      values[code.nick.gsub("-", "_").to_sym] = value
    end
    values
  end
end

#ingest(table_name, values, mode: :create) ⇒ Object



26
27
28
29
30
# File 'lib/adbc/connection-operations.rb', line 26

def ingest(table_name, values, mode: :create)
  open_statment do |statement|
    statement.ingest(table_name, values, mode: mode)
  end
end

#query(sql, &block) ⇒ Object



20
21
22
23
24
# File 'lib/adbc/connection-operations.rb', line 20

def query(sql, &block)
  open_statement do |statement|
    statement.query(sql, &block)
  end
end