Module: Immudb::Database

Defined in:
lib/immudb/database.rb

Class Method Summary collapse

Class Method Details

.encode_entry_spec(key, md, value) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/immudb/database.rb', line 24

def encode_entry_spec(key, md, value)
  EntrySpec.new(
    key: wrap_with_prefix(key, SET_KEY_PREFIX),
    md: md,
    value: wrap_with_prefix(value, PLAIN_VALUE_PREFIX)
  )
end

.encode_key(key) ⇒ Object



20
21
22
# File 'lib/immudb/database.rb', line 20

def encode_key(key)
  wrap_with_prefix(key, SET_KEY_PREFIX)
end

.wrap_with_prefix(b, prefix) ⇒ Object



16
17
18
# File 'lib/immudb/database.rb', line 16

def wrap_with_prefix(b, prefix)
  prefix + b
end