From 38faf7eeba7fb464334f23d0dc513363712c648d Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Mon, 14 Aug 2023 21:11:35 -0300 Subject: [PATCH] Update docs regarding ConnectionBuilder (#188) --- src/db/driver.cr | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/db/driver.cr b/src/db/driver.cr index 0f4d60f..be7e129 100644 --- a/src/db/driver.cr +++ b/src/db/driver.cr @@ -7,10 +7,21 @@ module DB # require "db" # # class FakeDriver < DB::Driver - # def connection_builder(uri : URI) : Proc(DB::Connection) + # class FakeConnectionBuilder < DB::ConnectionBuilder + # def initialize(@options : DB::Connection::Options) + # end + # + # def build : DB::Connection + # FakeConnection.new(@options) + # end + # end + # + # def connection_builder(uri : URI) : ConnectionBuilder # params = HTTP::Params.parse(uri.query || "") # options = connection_options(params) - # ->{ FakeConnection.new(options).as(DB::Connection) } + # # If needed, parse custom options from uri here + # # so they are parsed only once. + # FakeConnectionBuilder.new(options) # end # end #