mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Update docs regarding ConnectionBuilder
This commit is contained in:
parent
9471b33ffe
commit
f39edceb3e
1 changed files with 13 additions and 2 deletions
|
@ -7,10 +7,21 @@ module DB
|
||||||
# require "db"
|
# require "db"
|
||||||
#
|
#
|
||||||
# class FakeDriver < DB::Driver
|
# 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 || "")
|
# params = HTTP::Params.parse(uri.query || "")
|
||||||
# options = connection_options(params)
|
# 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
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue