Skip to content

Commit

Permalink
Merge pull request #11 from crystal-lang/feature/unprepared
Browse files Browse the repository at this point in the history
update to crystal-db feature/unprepared branch
  • Loading branch information
bcardiff authored Dec 13, 2016
2 parents 71347ad + 242e3df commit c39220e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sqlite3/connection.cr
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@ class SQLite3::Connection < DB::Connection
end)
end

def build_statement(query)
def build_prepared_statement(query)
Statement.new(self, query)
end

def build_unprepared_statement(query)
# sqlite3 does not support unprepared statement.
# All statements once prepared should be released
# when unneeded. Unprepared statement are not aim
# to leave state in the connection. Mimicking them
# with prepared statement would be wrong with
# respect connection resources.
raise DB::Error.new("SQLite3 driver does not support unprepared statements")
end

def do_close
super
LibSQLite3.close_v2(self)
Expand Down

0 comments on commit c39220e

Please sign in to comment.