class Blazer::Adapters::BaseAdapter

Attributes

data_source[R]

Public Class Methods

new(data_source) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 6
def initialize(data_source)
  @data_source = data_source
end

Public Instance Methods

cachable?(statement) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 57
def cachable?(statement)
  true # optional
end
cancel(run_id) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 53
def cancel(run_id)
  # optional
end
cohort_analysis_statement(statement, period:, days:) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 65
def cohort_analysis_statement(statement, period:, days:)
  # optional
end
cost(statement) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 45
def cost(statement)
  # optional
end
explain(statement) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 49
def explain(statement)
  # optional
end
parameter_binding() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 21
def parameter_binding
  # optional, but recommended when possible for security
  # if specified, quoting is only used for display
  # :positional - ?
  # :numeric - $1
  # ->(statement, values) { ... } - custom method
end
preview_statement() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 37
def preview_statement
  "" # also optional, but nice to have
end
quoting() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 14
def quoting
  # required, how to quote variables
  # :backslash_escape - single quote strings and convert ' to \' and \ to \\
  # :single_quote_escape - single quote strings and convert ' to ''
  # ->(value) { ... } - custom method
end
reconnect() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 41
def reconnect
  # optional
end
run_statement(statement, comment) click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 10
def run_statement(statement, comment)
  # required
end
schema() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 33
def schema
  [] # optional, but nice to have
end
supports_cohort_analysis?() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 61
def supports_cohort_analysis?
  false # optional
end
tables() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 29
def tables
  [] # optional, but nice to have
end

Protected Instance Methods

settings() click to toggle source
# File lib/blazer/adapters/base_adapter.rb, line 71
def settings
  @data_source.settings
end