|
@@ -0,0 +1,53 @@
|
|
1
|
+#-*- coding:utf-8 -*-
|
|
2
|
+
|
|
3
|
+class DummyDatasource(object):
|
|
4
|
+
|
|
5
|
+ def __init__(self, *conn_args, **conn_kwargs):
|
|
6
|
+ self.conn_args = conn_args
|
|
7
|
+ self.conn_kwargs = conn_kwargs
|
|
8
|
+
|
|
9
|
+ ## @brief returns a selection of documents from the datasource
|
|
10
|
+ # @param target_cls Emclass
|
|
11
|
+ # @param field_list list
|
|
12
|
+ # @param filters list : List of filters
|
|
13
|
+ # @param rel_filters list : List of relational filters
|
|
14
|
+ # @param order list : List of column to order. ex: order = [('title', 'ASC'),]
|
|
15
|
+ # @param group list : List of tupple representing the column to group together. ex: group = [('title', 'ASC'),]
|
|
16
|
+ # @param limit int : Number of records to be returned
|
|
17
|
+ # @param offset int: used with limit to choose the start record
|
|
18
|
+ # @param instanciate bool : If true, the records are returned as instances, else they are returned as dict
|
|
19
|
+ # @return list
|
|
20
|
+ def select(self, target_cls, field_list, filters, rel_filters=None, order=None, group=None, limit=None, offset=0,
|
|
21
|
+ instanciate=True):
|
|
22
|
+ pass
|
|
23
|
+
|
|
24
|
+ ##@brief Deletes records according to given filters
|
|
25
|
+ #@param target Emclass : class of the record to delete
|
|
26
|
+ #@param filters list : List of filters
|
|
27
|
+ #@param relational_filters list : List of relational filters
|
|
28
|
+ #@return int : number of deleted records
|
|
29
|
+ def delete(self, target, filters, relational_filters):
|
|
30
|
+ pass
|
|
31
|
+
|
|
32
|
+ ## @brief updates records according to given filters
|
|
33
|
+ #@param target Emclass : class of the object to insert
|
|
34
|
+ #@param filters list : List of filters
|
|
35
|
+ #@param rel_filters list : List of relational filters
|
|
36
|
+ #@param upd_datas dict : datas to update (new values)
|
|
37
|
+ #@return int : Number of updated records
|
|
38
|
+ def update(self, target, filters, relational_filters, upd_datas):
|
|
39
|
+ pass
|
|
40
|
+
|
|
41
|
+ ## @brief Inserts a record in a given collection
|
|
42
|
+ # @param target Emclass : class of the object to insert
|
|
43
|
+ # @param new_datas dict : datas to insert
|
|
44
|
+ # @return the inserted uid
|
|
45
|
+ def insert(self, target, new_datas):
|
|
46
|
+ pass
|
|
47
|
+
|
|
48
|
+ ## @brief Inserts a list of records in a given collection
|
|
49
|
+ # @param target Emclass : class of the objects inserted
|
|
50
|
+ # @param datas_list list : list of dict
|
|
51
|
+ # @return list : list of the inserted records' ids
|
|
52
|
+ def insert_multi(self, target, datas_list):
|
|
53
|
+ pass
|