mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
Drop :nodoc: Database#initialize
This commit is contained in:
parent
5515b78a53
commit
cebb113901
2 changed files with 6 additions and 10 deletions
|
@ -152,7 +152,12 @@ module DB
|
||||||
end
|
end
|
||||||
|
|
||||||
private def self.build_database(uri : URI)
|
private def self.build_database(uri : URI)
|
||||||
Database.new(build_driver(uri), uri)
|
driver = build_driver(uri)
|
||||||
|
params = HTTP::Params.parse(uri.query || "")
|
||||||
|
connection_options = driver.connection_options(params)
|
||||||
|
pool_options = driver.pool_options(params)
|
||||||
|
factory = driver.connection_builder(uri)
|
||||||
|
Database.new(connection_options, pool_options, &factory)
|
||||||
end
|
end
|
||||||
|
|
||||||
private def self.build_connection(connection_string : String)
|
private def self.build_connection(connection_string : String)
|
||||||
|
|
|
@ -39,15 +39,6 @@ module DB
|
||||||
@setup_connection : Connection -> Nil
|
@setup_connection : Connection -> Nil
|
||||||
@statements_cache = StringKeyCache(PoolPreparedStatement).new
|
@statements_cache = StringKeyCache(PoolPreparedStatement).new
|
||||||
|
|
||||||
# :nodoc:
|
|
||||||
def initialize(driver : Driver, uri : URI)
|
|
||||||
params = HTTP::Params.parse(uri.query || "")
|
|
||||||
connection_options = driver.connection_options(params)
|
|
||||||
pool_options = driver.pool_options(params)
|
|
||||||
factory = driver.connection_builder(uri)
|
|
||||||
initialize(connection_options, pool_options, &factory)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Initialize a database with the specified options and connection factory.
|
# Initialize a database with the specified options and connection factory.
|
||||||
# This covers more advanced use cases that might not be supported by an URI connection string such as tunneling connection.
|
# This covers more advanced use cases that might not be supported by an URI connection string such as tunneling connection.
|
||||||
def initialize(connection_options : Connection::Options, pool_options : Pool::Options, &factory : -> Connection)
|
def initialize(connection_options : Connection::Options, pool_options : Pool::Options, &factory : -> Connection)
|
||||||
|
|
Loading…
Reference in a new issue