Class: SqlWrangler::SqLiteConnection

Inherits:
SqlConnection show all
Defined in:
lib/sql_wrangler.rb

Instance Method Summary collapse

Methods inherited from SqlConnection

#query

Constructor Details

#initialize(db_path) ⇒ SqLiteConnection

Returns a new instance of SqLiteConnection.



15
16
17
# File 'lib/sql_wrangler.rb', line 15

def initialize(db_path)
  @db = SQLite3::Database.new db_path
end

Instance Method Details

#closeObject



27
28
29
# File 'lib/sql_wrangler.rb', line 27

def close
  @db.close
end

#command(sql_string) ⇒ Object



23
24
25
# File 'lib/sql_wrangler.rb', line 23

def command(sql_string)
  @db.execute_batch(sql_string)
end

#execute_sql(sql_string, params = {}) ⇒ Object



19
20
21
# File 'lib/sql_wrangler.rb', line 19

def execute_sql(sql_string, params={})
  @db.execute2(sql_string, params)
end