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:
Brian J. Cardiff 2023-06-23 15:36:08 -03:00 committed by GitHub
parent 79615e6c85
commit c08fc2befc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 52 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