Class: SqlWrangler::SqLiteConnection
- Inherits:
-
SqlConnection
- Object
- SqlConnection
- SqlWrangler::SqLiteConnection
- Defined in:
- lib/sql_wrangler.rb
Instance Method Summary collapse
- #close ⇒ Object
- #command(sql_string) ⇒ Object
- #execute_sql(sql_string, params = {}) ⇒ Object
-
#initialize(db_path) ⇒ SqLiteConnection
constructor
A new instance of SqLiteConnection.
Methods inherited from SqlConnection
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
#close ⇒ Object
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 |