mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
* add a library which defines available datasources as constants * include thread_pool gem and concurrent-ruby gem * modify per process connection_pools global variable to be a concurrent map datastructure * add a new DsConnectionPool libary to provide the api for using connections from a connection pool * convert the connection pool parameters in the ENV to integers before using them * add a new function in the ds_connection_pool library to reset_connection_pool/s * add unit tests for the ds_connection_pool library * fix typo * better variable names and module_names * refactor connection pool library test cases to use mocked query service * add magic comment to make strings frozen * remove airtable from the list of connection pooled datasources * separate module inside available_data_sources to list connection poolable datasources * use datasource_id as the key for storing connection pools of a type; Also handle cases when the pools connections are stale * add additional test cases for the connection pool library * fix rubocop errors
23 lines
541 B
Ruby
23 lines
541 B
Ruby
# frozen_string_literal: true
|
|
|
|
module AvailableDataSource
|
|
class UnSupportedSource < StandardError; end
|
|
|
|
module ConnectionPooled
|
|
POSTGRES = "POSTGRES"
|
|
DYNAMODB = "DYNAMODB"
|
|
ELASTICSEARCH = "ELASTICSEARCH"
|
|
FIRESTORE = "FIRESTORE"
|
|
MONGODB = "MONGODB"
|
|
MSSQL = "MSSQL"
|
|
MYSQL = "MYSQL"
|
|
REDIS = "REDIS"
|
|
|
|
def source_type_supported?(datasource_type)
|
|
ConnectionPooled
|
|
.constants
|
|
.map { |constant| ConnectionPooled.const_get(constant) }
|
|
.include?(datasource_type)
|
|
end
|
|
end
|
|
end
|