mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
changes needed due to 3c91978d36
add posibility to inspect availability of a resource in a pool (testing only) allow access to internal connection pool of db (testing only)
This commit is contained in:
parent
3c91978d36
commit
8d891a5a4e
4 changed files with 28 additions and 1 deletions
|
@ -16,6 +16,8 @@ module DB
|
|||
class Database
|
||||
# :nodoc:
|
||||
getter driver
|
||||
# :nodoc:
|
||||
getter pool
|
||||
|
||||
# Returns the uri with the connection settings to the database
|
||||
getter uri
|
||||
|
|
|
@ -53,6 +53,11 @@ module DB
|
|||
end
|
||||
end
|
||||
|
||||
# :nodon:
|
||||
def is_available?(resource : T)
|
||||
@available.includes?(resource)
|
||||
end
|
||||
|
||||
private def build_resource : T
|
||||
resource = @factory.call
|
||||
@total << resource
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue