Feature: Test AWS DynamoDB connection

This commit is contained in:
navaneeth 2021-05-13 18:02:41 +05:30
parent 7887792881
commit 6ad3970212
4 changed files with 1113 additions and 3 deletions

View file

@ -36,6 +36,7 @@ gem 'redis'
gem 'simple_command'
gem 'typhoeus'
gem 'mongo'
gem 'aws-sdk', '~> 3'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
class DynamodbQueryService
attr_accessor :data_query, :data_source, :options, :source_options, :current_user
def initialize(data_query, options, source_options, current_user)
@data_query = data_query
@data_source = data_query.data_source
@options = options
@source_options = source_options
@current_user = current_user
end
def self.connection options
region = options.dig('region', 'value')
access_key = options.dig('access_key', 'value')
secret_key = options.dig('secret_key', 'value')
credentials = Aws::Credentials.new(access_key, secret_key)
dynamodb = Aws::DynamoDB::Client.new(region: region, credentials: credentials)
dynamodb.list_tables
end
def process
end
end

View file

@ -1,6 +1,4 @@
class MongodbQueryService
require 'redis'
attr_accessor :data_query, :data_source, :options, :source_options, :current_user
def initialize(data_query, options, source_options, current_user)
@ -28,7 +26,7 @@ class MongodbQueryService
user: user,
password: password
)
connection.collections
end