Add method Diversipub::Main#postgresql_pool

This commit is contained in:
Alex Kotov 2023-05-10 14:40:17 +04:00
parent 91a65d0274
commit 25d7fc96d0
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -81,6 +81,19 @@ module Diversipub
end.freeze
end
def postgresql_pool
@postgresql_pool ||= ConnectionPool.new do
PG.connect(
host: 'localhost',
dbname: 'diversipub',
user: 'diversipub',
password: 'diversipub',
).tap do |conn|
conn.type_map_for_results = PG::BasicTypeMapForResults.new conn
end
end
end
def puma_task
@puma_task ||= PumaTask.new self
end