Refactor connection builder

This commit is contained in:
Brian J. Cardiff 2023-05-29 17:20:11 -03:00
parent 79615e6c85
commit 2b41d39269
4 changed files with 58 additions and 50 deletions

View file

@ -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

View file

@ -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