From 52f725c1c60e3b22e73ee030bf04bbdf7ed5513d Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Mon, 29 May 2023 13:42:53 -0300 Subject: [PATCH] Drop uri getter from database --- src/db/database.cr | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/db/database.cr b/src/db/database.cr index 1b8c4d6..1f8bd60 100644 --- a/src/db/database.cr +++ b/src/db/database.cr @@ -34,22 +34,19 @@ module DB # :nodoc: getter pool - # Returns the uri with the connection settings to the database - getter uri : URI - @connection_options : Connection::Options @pool : Pool(Connection) @setup_connection : Connection -> Nil @statements_cache = StringKeyCache(PoolPreparedStatement).new # :nodoc: - def initialize(driver : Driver, @uri : URI) + def initialize(driver : Driver, uri : URI) params = HTTP::Params.parse(uri.query || "") @connection_options = driver.connection_options(params) pool_options = driver.pool_options(params) @setup_connection = ->(conn : Connection) {} - factory = driver.connection_builder(@uri) + factory = driver.connection_builder(uri) @pool = uninitialized Pool(Connection) # in order to use self in the factory proc @pool = Pool.new(pool_options) { conn = factory.call