Repository URL to install this package:
|
Version:
7.3.3 ▾
|
# frozen_string_literal: true
require 'singleton'
module Faculty
module DatabaseHelper
# Set up a connection to the database as 'postgres' with full admin access
module AdminConnection
# Create a connection to the DB as a singleton
class Connection
include Singleton
def connection
@connection ||= Sequel.connect(
adapter: 'postgres',
host: ENV.fetch('DB_HOST', nil),
database: 'faculty',
user: 'postgres',
search_path: 'groupmanager,rbac'
)
end
end
def connection
Connection.instance.connection
end
end
end
end