-
Notifications
You must be signed in to change notification settings - Fork 390
/
dbview.pxd
225 lines (179 loc) · 5.85 KB
/
dbview.pxd
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2018-present MagicStack Inc. and the EdgeDB authors.
#
# 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.
#
cimport cython
from libc.stdint cimport uint64_t
from edb.server.cache cimport stmt_cache
cdef DEFAULT_STATE
cpdef enum SideEffects:
SchemaChanges = 1 << 0
DatabaseConfigChanges = 1 << 1
InstanceConfigChanges = 1 << 2
GlobalSchemaChanges = 1 << 3
DatabaseChanges = 1 << 4
@cython.final
cdef class CompiledQuery:
cdef public object query_unit_group
cdef public object first_extra # Optional[int]
cdef public object extra_counts
cdef public object extra_blobs
cdef public object request
cdef public object recompiled_cache
cdef class DatabaseIndex:
cdef:
dict _dbs
object _server
object _tenant
object _sys_config
object _comp_sys_config
object _std_schema
object _global_schema_pickle
object _default_sysconfig
object _sys_config_spec
object _cached_compiler_args
cdef invalidate_caches(self)
cdef inline set_current_branches(self)
cdef class Database:
cdef:
stmt_cache.StatementsCache _eql_to_compiled
object _cache_locks
object _sql_to_compiled
DatabaseIndex _index
object _views
object _introspection_lock
object _state_serializers
readonly object user_config_spec
readonly str name
readonly object schema_version
readonly object dbver
readonly object db_config
readonly bytes user_schema_pickle
readonly object reflection_cache
readonly object backend_ids
readonly object extensions
cdef schedule_config_update(self)
cdef _invalidate_caches(self)
cdef _cache_compiled_query(self, key, compiled)
cdef _new_view(self, query_cache, protocol_version)
cdef _remove_view(self, view)
cdef _observe_auth_ext_config(self)
cdef _update_backend_ids(self, new_types)
cdef _set_and_signal_new_user_schema(
self,
new_schema_pickle,
schema_version,
extensions,
ext_config_settings,
reflection_cache=?,
backend_ids=?,
db_config=?,
)
cdef get_state_serializer(self, protocol_version)
cpdef set_state_serializer(self, protocol_version, serializer)
cdef class DatabaseConnectionView:
cdef:
Database _db
bint _query_cache_enabled
object _protocol_version
object _db_config_temp
object _db_config_dbver
# State properties
object _config
object _in_tx_config
object _globals
object _in_tx_globals
object _modaliases
object _in_tx_modaliases
object _state_serializer
object _in_tx_state_serializer
object _command_state_serializer
tuple _session_state_db_cache
tuple _session_state_cache
object _txid
object _in_tx_db_config
object _in_tx_savepoints
object _in_tx_user_schema_pickle
object _in_tx_user_schema_version
object _in_tx_user_config_spec
object _in_tx_global_schema_pickle
object _in_tx_new_types
int _in_tx_dbver
bint _in_tx
bint _in_tx_with_ddl
bint _in_tx_with_sysconfig
bint _in_tx_with_dbconfig
bint _in_tx_with_set
bint _tx_error
uint64_t _capability_mask
object _last_comp_state
int _last_comp_state_id
object __weakref__
cdef _reset_tx_state(self)
cdef inline _check_in_tx_error(self, query_unit_group)
cdef clear_tx_error(self)
cdef rollback_tx_to_savepoint(self, name)
cdef declare_savepoint(self, name, spid)
cdef recover_aliases_and_config(self, modaliases, config, globals)
cdef abort_tx(self)
cpdef in_tx(self)
cpdef in_tx_error(self)
cdef cache_compiled_query(self, object key, object query_unit_group)
cdef lookup_compiled_query(self, object key)
cdef as_compiled(self, query_req, query_unit_group, bint use_metrics=?)
cdef tx_error(self)
cdef start(self, query_unit)
cdef start_tx(self)
cdef _apply_in_tx(self, query_unit)
cdef start_implicit(self, query_unit)
cdef on_error(self)
cdef on_success(self, query_unit, new_types)
cdef commit_implicit_tx(
self,
user_schema,
extensions,
ext_config_settings,
global_schema,
roles,
cached_reflection,
)
cdef get_user_config_spec(self)
cpdef get_config_spec(self)
cpdef get_session_config(self)
cdef set_session_config(self, new_conf)
cpdef get_globals(self)
cpdef set_globals(self, new_globals)
cdef get_state_serializer(self)
cdef set_state_serializer(self, new_serializer)
cdef update_database_config(self)
cpdef get_database_config(self)
cdef set_database_config(self, new_conf)
cdef get_system_config(self)
cpdef get_compilation_system_config(self)
cdef set_modaliases(self, new_aliases)
cpdef get_modaliases(self)
cdef bytes serialize_state(self)
cdef bint is_state_desc_changed(self)
cdef describe_state(self)
cdef encode_state(self)
cdef decode_state(self, type_id, data)
cdef check_capabilities(
self,
query_capabilities,
allowed_capabilities,
error_constructor,
reason,
)