Copyright © Inaka <hello@inaka.net>
Behaviours: gen_server.
This module defines the sumo_store behaviour.
Required callback functions: init/1, persist/2, fetch/3, delete_by/3, delete_all/2, find_by/3, find_by/5, find_by/6, find_all/2, find_all/5, create_schema/2.
Main interface for stores.
Copyright 2012 Inaka <hello@inaka.net>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.affected_rows() = unknown | non_neg_integer()
result(S) = {ok, S} | {error, term(), S}
result(R, S) = {ok, R, S} | {error, term(), S}
call/4 | Calls a custom function in the given store name. |
create_schema/2 | Creates the schema of the given docs in the given store name. |
delete_all/2 | Deletes all docs in the given store name. |
delete_by/3 | Deletes the docs identified by the given conditions. |
fetch/3 | Fetch a single doc by its Id . |
find_all/2 | Returns all docs from the given store name. |
find_all/5 | Returns Limit docs starting at Offset from the given store name, ordered by OrderField. |
find_by/3 | Finds documents that match the given conditions in the given store name. |
find_by/5 | Finds documents that match the given conditions in the given store name. |
find_by/6 | Finds documents that match the given conditions in the given store name. |
persist/2 | Persist the given doc with the given store name. |
start_link/3 | Starts and links a new process for the given store implementation. |
call(Name, DocName, Function, Args) -> Res
Calls a custom function in the given store name.
create_schema(Name::atom(), Schema::sumo:schema()) -> ok | {error, term()}
Creates the schema of the given docs in the given store name.
delete_all(Name, DocName) -> Res
Deletes all docs in the given store name.
delete_by(Name, DocName, Conditions) -> Res
Deletes the docs identified by the given conditions.
fetch(Name, DocName, Id) -> Res
Fetch a single doc by its Id
.
find_all(Name, DocName) -> Res
Returns all docs from the given store name.
find_all(Name, DocName, SortFields, Limit, Offset) -> Res
Returns Limit docs starting at Offset from the given store name, ordered by OrderField. OrderField may be 'undefined'.
find_by(Name, DocName, Conditions) -> Res
Finds documents that match the given conditions in the given store name.
find_by(Name, DocName, Conditions, Limit, Offset) -> Res
Finds documents that match the given conditions in the given store name.
find_by(Name, DocName, Conditions, SortFields, Limit, Offset) -> Res
Finds documents that match the given conditions in the given store name.
persist(Name, Doc) -> Res
Persist the given doc with the given store name.
start_link(Name::atom(), Module::module(), Options::[term()]) -> {ok, pid()}
Starts and links a new process for the given store implementation.
Generated by EDoc, Sep 29 2016, 11:57:22.