Class: Simpleadmin::DatabaseConnector

Inherits:
Object
  • Object
show all
Defined in:
lib/simpleadmin/database_connector.rb

Overview

Connector service that handles different databases to provide unified API endpoints

Since:

  • 1.0.0

Constant Summary collapse

ADAPTERS_MAPPER =

Since:

  • 1.0.0

{
  postgres: Adapters::Postgres
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(database_credentials:) ⇒ DatabaseConnector

Returns a new instance of DatabaseConnector.

Since:

  • 1.0.0



16
17
18
# File 'lib/simpleadmin/database_connector.rb', line 16

def initialize(database_credentials:)
  @database_credentials = database_credentials
end

Instance Method Details

#clientObject

Since:

  • 1.0.0



20
21
22
# File 'lib/simpleadmin/database_connector.rb', line 20

def client
  adapter.new(database_credentials: database_credentials)
end