mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
Update to crystal-db 0.12.0 (refactor connection factory) (#91)
* Refactor connection builder * Update for ConnectionBuilder * Update to crystal-db ~> 0.12.0 * run crystal tool format
This commit is contained in:
parent
79615e6c85
commit
c08fc2befc
5 changed files with 66 additions and 52 deletions
|
@ -13,7 +13,7 @@ private def cast_if_blob(expr, sql_type)
|
|||
end
|
||||
end
|
||||
|
||||
DB::DriverSpecs(DB::Any).run do
|
||||
DB::DriverSpecs(DB::Any).run do |ctx|
|
||||
support_unprepared false
|
||||
|
||||
before do
|
||||
|
@ -104,7 +104,7 @@ DB::DriverSpecs(DB::Any).run do
|
|||
db.exec %(insert into a (i, str) values (23, "bai bai");)
|
||||
|
||||
2.times do |i|
|
||||
DB.open db.uri do |db|
|
||||
DB.open ctx.connection_string do |db|
|
||||
begin
|
||||
db.query("SELECT i, str FROM a WHERE i = ?", 23) do |rs|
|
||||
rs.move_next
|
||||
|
|
|
@ -27,7 +27,7 @@ describe Driver do
|
|||
|
||||
it "should use database option as file to open" do
|
||||
with_db do |db|
|
||||
db.driver.should be_a(SQLite3::Driver)
|
||||
db.checkout.should be_a(SQLite3::Connection)
|
||||
File.exists?(DB_FILENAME).should be_true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue