class Purview::RawConnections::SQLite3

Private Instance Methods

execute_sql(sql, opts={}) click to toggle source
# File lib/purview/raw_connections/sqlite3.rb, line 9
def execute_sql(sql, opts={})
  raw_connection.execute(sql)
end
extract_rows(result) click to toggle source
# File lib/purview/raw_connections/sqlite3.rb, line 13
def extract_rows(result)
  result && result.map do |rows|
    rows.reduce({}) do |memo, (key, value)|
      memo[key.to_sym] = value unless key.is_a?(Integer)
      memo
    end
  end
end
extract_rows_affected(result) click to toggle source
# File lib/purview/raw_connections/sqlite3.rb, line 22
def extract_rows_affected(result)
  raw_connection.changes
end
new_connection() click to toggle source
# File lib/purview/raw_connections/sqlite3.rb, line 26
def new_connection
  ::SQLite3::Database.new(database.to_s, {:results_as_hash => true})
end