-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathsnipe_data.py
More file actions
86 lines (71 loc) · 1.78 KB
/
Copy pathsnipe_data.py
File metadata and controls
86 lines (71 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
from storage.engine import CollectionStore, NOW
CollectionName = 'snipe_data'
_store = CollectionStore(
name=CollectionName,
defaults={'type': 'delete', 'created_at': NOW},
unique_sets=[['channel_id', 'message_id', 'type']],
json_fields=set([]),
datetime_fields=set(['created_at']),
sequence_fields={},
update_cache=('snipe_data_cache', ['channel_id']),
delete_cache=('snipe_data_cache', ['channel_id', 'type']),
)
async def create_table():
return await _store.prepare()
async def insert(
id:int=None,
channel_id:int=None,
message_id:int=None,
type:str=None,
before_content:str=None,
after_content:str=None,
author_id:int=None,
created_at:str=None
):
return await _store.insert(locals())
async def update(
id:int,
channel_id:int=None,
message_id:int=None,
type:str=None,
before_content:str=None,
after_content:str=None,
author_id:int=None,
created_at:str=None
):
return await _store.update(locals())
async def get(
id:int=None,
channel_id:int=None,
message_id:int=None,
type:str=None,
before_content:str=None,
after_content:str=None,
author_id:int=None,
created_at:str=None
):
return await _store.get(locals())
async def gets(
id:int=None,
channel_id:int=None,
message_id:int=None,
type:str=None,
before_content:str=None,
after_content:str=None,
author_id:int=None,
created_at:str=None
):
return await _store.gets(locals())
async def delete(
id:int=None,
channel_id:int=None,
message_id:int=None,
type:str=None,
before_content:str=None,
after_content:str=None,
author_id:int=None,
created_at:str=None
):
return await _store.delete(locals())
async def get_all():
return await _store.get_all()