Class: Bmg::Sql::Relation

Inherits:
Object
  • Object
show all
Includes:
Relation
Defined in:
lib/bmg/sql/relation.rb

Direct Known Subclasses

Bmg::Sequel::Relation

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Relation

#debug, empty, #empty?, new, #one, #one_or_nil, #to_json, #visit, #with_typecheck, #without_typecheck, #ys_by_x

Methods included from Algebra

#allbut, #autosummarize, #autowrap, #constants, #extend, #group, #image, #join, #matching, #materialize, #not_matching, #page, #project, #rename, #restrict, #spied, #summarize, #union, #unspied

Methods included from Algebra::Shortcuts

#image, #join, #matching, #not_matching, #prefix, #rxmatch, #suffix

Constructor Details

#initialize(type, builder, expr) ⇒ Relation

Returns a new instance of Relation.



6
7
8
9
10
# File 'lib/bmg/sql/relation.rb', line 6

def initialize(type, builder, expr)
  @type = type
  @builder = builder
  @expr = expr
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



12
13
14
# File 'lib/bmg/sql/relation.rb', line 12

def type
  @type
end

Instance Method Details

#deleteObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/bmg/sql/relation.rb', line 25

def delete
  raise NotImplementedError
end

#each(&bl) ⇒ Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/bmg/sql/relation.rb', line 21

def each(&bl)
  raise NotImplementedError
end

#insert(arg) ⇒ Object

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/bmg/sql/relation.rb', line 29

def insert(arg)
  raise NotImplementedError
end

#to_astObject



175
176
177
# File 'lib/bmg/sql/relation.rb', line 175

def to_ast
  [:sql, to_sql]
end

#to_sObject Also known as: inspect



179
180
181
# File 'lib/bmg/sql/relation.rb', line 179

def to_s
  "(sql #{to_sql})"
end

#to_sqlObject



171
172
173
# File 'lib/bmg/sql/relation.rb', line 171

def to_sql
  expr.to_sql("", Dialect.default)
end

#update(arg) ⇒ Object

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/bmg/sql/relation.rb', line 33

def update(arg)
  raise NotImplementedError
end