diff --git a/lib/blazer/data_source.rb b/lib/blazer/data_source.rb index 235bd5c5d..b9de0b084 100644 --- a/lib/blazer/data_source.rb +++ b/lib/blazer/data_source.rb @@ -144,6 +144,7 @@ def run_cache_key(run_id) def adapter_instance @adapter_instance ||= begin + # TODO add required settings to adapters unless settings["url"] || Rails.env.development? || ["bigquery", "athena", "snowflake", "salesforce"].include?(settings["adapter"]) raise Blazer::Error, "Empty url for data source: #{id}" end @@ -182,11 +183,12 @@ def run_statement_helper(statement, comment, run_id) Blazer::Result.new(self, columns, rows, error, nil, cache && !cache_data.nil?) end + # TODO check for adapter with same name, default to sql def detect_adapter - schema = settings["url"].to_s.split("://").first - case schema + scheme = settings["url"].to_s.split("://").first + case scheme when "mongodb", "presto", "cassandra", "ignite" - schema + scheme else "sql" end