Module: Volt::DataStore::SqlAdaptorClient::SqlArrayStore

Defined in:
app/sql/lib/sql_adaptor_client.rb

Instance Method Summary collapse

Instance Method Details

#count(*args, &block) ⇒ Object

Count without arguments or a block makes its own query to the backend. If you pass an arg or block, it will run “‘all“` on the Cursor, then run a normal ruby “`.count“` on it, passing the args.



14
15
16
17
18
19
20
21
22
# File 'app/sql/lib/sql_adaptor_client.rb', line 14

def count(*args, &block)
  if args || block
    @model.reactive_count(*args, &block)
  else
    cursor = add_query_part(:count)

    cursor.persistor.value
  end
end

#skip(*args) ⇒ Object



7
8
9
# File 'app/sql/lib/sql_adaptor_client.rb', line 7

def skip(*args)
  add_query_part(:offset, *args)
end