Skip to content

Commit

Permalink
Added todos and fixed variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 10, 2021
1 parent 1c5117b commit 307886c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/blazer/data_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 307886c

Please sign in to comment.