Class: Alf::Adapter::Memory::Connection

Inherits:
Connection
  • Object
show all
Defined in:
lib/alf/adapter/memory/connection.rb

Instance Attribute Summary

Attributes inherited from Connection

#conn_spec

Instance Method Summary collapse

Methods inherited from Connection

#close, #closed?, #heading, #in_transaction, #keys, #lock, #migrate!

Constructor Details

#initialize(*args, &bl) ⇒ Connection


6
7
8
9
# File 'lib/alf/adapter/memory/connection.rb', line 6

def initialize(*args, &bl)
  super
  @relvars = {}
end

Instance Method Details

#cog(plan, expr) ⇒ Object

Returns a cog for `expr` inside the compilation plan `plan`


17
18
19
# File 'lib/alf/adapter/memory/connection.rb', line 17

def cog(plan, expr)
  _relvar(expr.name).to_cog
end

#delete(name, *args, &bl) ⇒ Object

Delete from the relvar called `name`


27
28
29
# File 'lib/alf/adapter/memory/connection.rb', line 27

def delete(name, *args, &bl)
  _relvar(name).delete(*args, &bl)
end

#insert(name, *args, &bl) ⇒ Object

Inserts `tuples` in the relvar called `name`


22
23
24
# File 'lib/alf/adapter/memory/connection.rb', line 22

def insert(name, *args, &bl)
  _relvar(name).insert(*args, &bl)
end

#knows?(name) ⇒ Boolean

Returns true if `name` is known, false otherwise.


12
13
14
# File 'lib/alf/adapter/memory/connection.rb', line 12

def knows?(name)
  true
end

#update(name, *args, &bl) ⇒ Object

Updates the relvar called `name`


32
33
34
# File 'lib/alf/adapter/memory/connection.rb', line 32

def update(name, *args, &bl)
  _relvar(name).update(*args, &bl)
end