Parent

Included Modules

Files

Class/Module Index [+]

Quicksearch

Tarantool::Query

Public Class Methods

new(tarantool) click to toggle source
# File lib/tarantool/query.rb, line 7
def initialize(tarantool)
  @tarantool = tarantool
  _init_shard_vars(nil, false)
end

Public Instance Methods

all_blk(space_no, index_no, keys, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 93
def all_blk(space_no, index_no, keys, opts={}, &block)
  all_cb(space_no, index_no, keys, block, opts)
end
all_cb(space_no, index_no, keys, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 23
def all_cb(space_no, index_no, keys, cb, opts={})
  select_cb(space_no, index_no, keys,
            opts[:offset] || 0, opts[:limit] || -1,
            cb, opts)
end
call_blk(func_name, values, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 125
def call_blk(func_name, values, opts={}, &block)
  call_cb(func_name, values, block, opts)
end
call_cb(func_name, values, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 77
def call_cb(func_name, values, cb, opts={})
  opts = opts.dup
  values = [*values]
  opts[:return_tuple] = true  if opts[:return_tuple].nil?
  opts[:types] ||= _detect_types(values)
  opts[:returns] ||= TYPES_AUTO
  if Hash === opts[:returns] && opts[:return_tuple]
    opts[:returns], *opts[:translators] = _parse_hash_definition(opts[:returns])
  end
  _call(func_name, values, cb, opts)
end
delete_blk(space_no, pk, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 117
def delete_blk(space_no, pk, opts={}, &block)
  delete_cb(space_no, pk, block, opts)
end
delete_cb(space_no, pk, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 59
def delete_cb(space_no, pk, cb, opts={})
  pk = [*pk]
  pk_types = opts[:pk_types] || _detect_types(pk)
  returns = opts[:returns] || TYPES_AUTO
  if Hash === returns && opts[:return_tuple]
    returns, *translators = _parse_hash_definition(returns)
  end
  _delete(space_no, pk, returns, pk_types, cb,
          opts[:return_tuple], all_shards, translators)
end
first_blk(space_no, index_no, key, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 97
def first_blk(space_no, index_no, key, opts={}, &block)
  first_cb(space_no, index_no, key, block, opts)
end
first_cb(space_no, index_no, key, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 29
def first_cb(space_no, index_no, key, cb, opts={})
  select_cb(space_no, index_no, [key], 0, :first, cb, opts)
end
insert_blk(space_no, tuple, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 101
def insert_blk(space_no, tuple, opts={}, &block)
  insert_cb(space_no, tuple, block, opts)
end
insert_cb(space_no, tuple, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 33
def insert_cb(space_no, tuple, cb, opts={})
  types = opts[:types] || _detect_types(tuple)
  _insert(space_no, BOX_ADD, tuple, types, cb, opts[:return_tuple], all_shards)
end
invoke_blk(func_name, values, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 121
def invoke_blk(func_name, values, opts={}, &block)
  invoke_cb(func_name, values, block, opts)
end
invoke_cb(func_name, values, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 70
def invoke_cb(func_name, values, cb, opts={})
  opts = opts.dup
  values = [*values]
  opts[:types] ||= _detect_types(values)
  _call(func_name, values, cb, opts)
end
ping_blk(&block) click to toggle source
# File lib/tarantool/query.rb, line 129
def ping_blk(&block)
  ping_cb(block)
end
replace_blk(space_no, tuple, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 105
def replace_blk(space_no, tuple, opts={}, &block)
  replace_cb(space_no, tuple, block, opts)
end
replace_cb(space_no, tuple, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 38
def replace_cb(space_no, tuple, cb, opts={})
  types = opts[:types] || _detect_types(tuple)
  _insert(space_no, BOX_REPLACE, tuple, types, cb, opts[:return_tuple], all_shards)
end
select_blk(space_no, index_no, keys, offset, limit, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 89
def select_blk(space_no, index_no, keys, offset, limit, opts={}, &block)
  select_cb(space_no, index_no, keys, offset, limit, block, opts)
end
select_cb(space_no, index_no, keys, offset, limit, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 12
def select_cb(space_no, index_no, keys, offset, limit, cb, opts={})
  keys = [*keys]
  types = opts[:types] || _detect_types(keys)
  returns = opts[:returns] || TYPES_AUTO
  if Hash === returns
    returns, *translators = _parse_hash_definition(returns)
  end
  _select(space_no, index_no, offset, limit, keys, cb, returns,
          types, all_shards, translators)
end
store_blk(space_no, tuple, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 109
def store_blk(space_no, tuple, opts={}, &block)
  store_cb(space_no, tuple, block, opts)
end
store_cb(space_no, tuple, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 43
def store_cb(space_no, tuple, cb, opts={})
  types = opts[:types] || _detect_types(tuple)
  _insert(space_no, 0, tuple, types, cb, opts[:return_tuple], all_shards)
end
update_blk(space_no, pk, operation, opts={}, &block) click to toggle source
# File lib/tarantool/query.rb, line 113
def update_blk(space_no, pk, operation, opts={}, &block)
  update_cb(space_no, pk, operation, block, opts={})
end
update_cb(space_no, pk, operations, cb, opts={}) click to toggle source
# File lib/tarantool/query.rb, line 48
def update_cb(space_no, pk, operations, cb, opts={})
  pk = [*pk]
  pk_types = opts[:pk_types] || _detect_types(pk)
  returns = opts[:returns] || TYPES_AUTO
  if Hash === returns && opts[:return_tuple]
    returns, *translators = _parse_hash_definition(returns)
  end
  _update(space_no, pk, operations, returns, pk_types, cb,
          opts[:return_tuple], all_shards, translators)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.