Class: Blazer::Adapters::BaseAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/blazer/adapters/base_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_source) ⇒ BaseAdapter

Returns a new instance of BaseAdapter.



6
7
8
# File 'lib/blazer/adapters/base_adapter.rb', line 6

def initialize(data_source)
  @data_source = data_source
end

Instance Attribute Details

#data_sourceObject (readonly)

Returns the value of attribute data_source.



4
5
6
# File 'lib/blazer/adapters/base_adapter.rb', line 4

def data_source
  @data_source
end

Instance Method Details

#cachable?(statement) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/blazer/adapters/base_adapter.rb', line 42

def cachable?(statement)
  true # optional
end

#cancel(run_id) ⇒ Object



38
39
40
# File 'lib/blazer/adapters/base_adapter.rb', line 38

def cancel(run_id)
  # optional
end

#cohort_analysis_statement(statement, period:, days:) ⇒ Object



50
51
52
# File 'lib/blazer/adapters/base_adapter.rb', line 50

def cohort_analysis_statement(statement, period:, days:)
  # optional
end

#cost(statement) ⇒ Object



30
31
32
# File 'lib/blazer/adapters/base_adapter.rb', line 30

def cost(statement)
  # optional
end

#explain(statement) ⇒ Object



34
35
36
# File 'lib/blazer/adapters/base_adapter.rb', line 34

def explain(statement)
  # optional
end

#preview_statementObject



22
23
24
# File 'lib/blazer/adapters/base_adapter.rb', line 22

def preview_statement
  "" # also optional, but nice to have
end

#reconnectObject



26
27
28
# File 'lib/blazer/adapters/base_adapter.rb', line 26

def reconnect
  # optional
end

#run_statement(statement, comment) ⇒ Object



10
11
12
# File 'lib/blazer/adapters/base_adapter.rb', line 10

def run_statement(statement, comment)
  # the one required method
end

#schemaObject



18
19
20
# File 'lib/blazer/adapters/base_adapter.rb', line 18

def schema
  [] # optional, but nice to have
end

#supports_cohort_analysis?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/blazer/adapters/base_adapter.rb', line 46

def supports_cohort_analysis?
  false # optional
end

#tablesObject



14
15
16
# File 'lib/blazer/adapters/base_adapter.rb', line 14

def tables
  [] # optional, but nice to have
end