pyexasol 2.2.3__tar.gz → 2.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyexasol-2.2.3 → pyexasol-2.3.1}/PKG-INFO +3 -2
- pyexasol-2.3.1/pyexasol/_sql_splitter.py +323 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/connection.py +20 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/http_transport.py +1 -1
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyproject.toml +7 -9
- {pyexasol-2.2.3 → pyexasol-2.3.1}/LICENSE.txt +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/README.md +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/__init__.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/__init__.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/_connection.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/_cursor.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/_errors.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/_protocols.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/_types.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/exasol/driver/websocket/dbapi2.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/__init__.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/__main__.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/_metadata.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/callback.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/constant.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/db2/__init__.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/exceptions.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/ext.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/formatter.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/local_config.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/logger.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/mapper.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/meta.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/py.typed +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/script_output.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/statement.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol/warnings.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/__init__.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/bench.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/bench_sql/prepare.sql +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/bench_sql/t1_group_by.sql +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/bench_sql/t2_local_join.sql +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/bench_sql/t3_global_join.sql +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/bench_sql/t4_sort.sql +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/docker_util.py +0 -0
- {pyexasol-2.2.3 → pyexasol-2.3.1}/pyexasol_utils/script_output.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyexasol
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Exasol python driver with extra features
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE.txt
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
19
|
Classifier: Intended Audience :: Developers
|
|
19
20
|
Classifier: Topic :: Database
|
|
20
21
|
Provides-Extra: all
|
|
@@ -44,7 +45,7 @@ Requires-Dist: python-rapidjson (>=1.21.0,<2.0.0) ; extra == "rapidjson"
|
|
|
44
45
|
Requires-Dist: ujson (>=5.10.0,<6.0.0) ; extra == "all"
|
|
45
46
|
Requires-Dist: ujson (>=5.10.0,<6.0.0) ; extra == "ujson"
|
|
46
47
|
Requires-Dist: websocket-client (>=1.0.1,<2)
|
|
47
|
-
Project-URL: Changelog, https://github.
|
|
48
|
+
Project-URL: Changelog, https://exasol.github.io/pyexasol/master/changes/changelog.html
|
|
48
49
|
Project-URL: Documentation, https://github.com/exasol/pyexasol/
|
|
49
50
|
Project-URL: Homepage, https://www.exasol.com/
|
|
50
51
|
Project-URL: Issues, https://github.com/exasol/pyexasol/issues
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
from enum import (
|
|
2
|
+
Enum,
|
|
3
|
+
auto,
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ScanState(Enum):
|
|
8
|
+
NORMAL = auto()
|
|
9
|
+
SINGLE_QUOTE = auto()
|
|
10
|
+
DOUBLE_QUOTE = auto()
|
|
11
|
+
LINE_COMMENT = auto()
|
|
12
|
+
BLOCK_COMMENT = auto()
|
|
13
|
+
SCRIPT_BODY = auto()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ScriptHeaderState(Enum):
|
|
17
|
+
NONE = auto()
|
|
18
|
+
SAW_CREATE = auto()
|
|
19
|
+
SAW_POSSIBLE_SCRIPT_LANGUAGE = auto()
|
|
20
|
+
SAW_SCRIPT_LANGUAGE = auto()
|
|
21
|
+
SAW_SCRIPT = auto()
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
SCRIPT_HEADER_WORDS = {
|
|
25
|
+
"ADAPTER",
|
|
26
|
+
"JAVA",
|
|
27
|
+
"LUA",
|
|
28
|
+
"OR",
|
|
29
|
+
"PREPROCESSOR",
|
|
30
|
+
"PYTHON",
|
|
31
|
+
"PYTHON3",
|
|
32
|
+
"R",
|
|
33
|
+
"REPLACE",
|
|
34
|
+
"SCALAR",
|
|
35
|
+
"SET",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class _CommentStripper:
|
|
40
|
+
def __init__(self, sql: str) -> None:
|
|
41
|
+
self.sql = sql
|
|
42
|
+
self.output: list[str] = []
|
|
43
|
+
self.state = ScanState.NORMAL
|
|
44
|
+
self.position = 0
|
|
45
|
+
|
|
46
|
+
def run(self) -> str:
|
|
47
|
+
while self.position < len(self.sql):
|
|
48
|
+
self.consume_current_character()
|
|
49
|
+
|
|
50
|
+
return "".join(self.output)
|
|
51
|
+
|
|
52
|
+
def consume_current_character(self) -> None:
|
|
53
|
+
if self.state == ScanState.SINGLE_QUOTE:
|
|
54
|
+
self.consume_quote("'")
|
|
55
|
+
elif self.state == ScanState.DOUBLE_QUOTE:
|
|
56
|
+
self.consume_quote('"')
|
|
57
|
+
elif self.current_char == "'":
|
|
58
|
+
self.enter_quote(ScanState.SINGLE_QUOTE)
|
|
59
|
+
elif self.current_char == '"':
|
|
60
|
+
self.enter_quote(ScanState.DOUBLE_QUOTE)
|
|
61
|
+
elif self.current_char == "-" and self.next_char == "-":
|
|
62
|
+
self.consume_line_comment()
|
|
63
|
+
elif self.current_char == "/" and self.next_char == "*":
|
|
64
|
+
self.consume_block_comment()
|
|
65
|
+
else:
|
|
66
|
+
self.append_current_char()
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def current_char(self) -> str:
|
|
70
|
+
return self.sql[self.position]
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def next_char(self) -> str | None:
|
|
74
|
+
lookahead = self.position + 1
|
|
75
|
+
return self.sql[lookahead] if lookahead < len(self.sql) else None
|
|
76
|
+
|
|
77
|
+
def consume_quote(self, quote: str) -> None:
|
|
78
|
+
self.append_current_char()
|
|
79
|
+
if self.output[-1] == quote:
|
|
80
|
+
self.state = ScanState.NORMAL
|
|
81
|
+
|
|
82
|
+
def enter_quote(self, state: ScanState) -> None:
|
|
83
|
+
self.output.append(self.current_char)
|
|
84
|
+
self.state = state
|
|
85
|
+
self.position += 1
|
|
86
|
+
|
|
87
|
+
def append_current_char(self) -> None:
|
|
88
|
+
self.output.append(self.current_char)
|
|
89
|
+
self.position += 1
|
|
90
|
+
|
|
91
|
+
def consume_line_comment(self) -> None:
|
|
92
|
+
self.output.append(" ")
|
|
93
|
+
self.position += 2
|
|
94
|
+
while self.position < len(self.sql) and self.current_char != "\n":
|
|
95
|
+
self.position += 1
|
|
96
|
+
|
|
97
|
+
def consume_block_comment(self) -> None:
|
|
98
|
+
self.output.append(" ")
|
|
99
|
+
self.position += 2
|
|
100
|
+
while self.position < len(self.sql):
|
|
101
|
+
if self.current_char == "*" and self.next_char == "/":
|
|
102
|
+
self.position += 2
|
|
103
|
+
return
|
|
104
|
+
self.position += 1
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def strip_comments(sql: str) -> str:
|
|
108
|
+
return _CommentStripper(sql).run()
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class _SqlScriptSplitter:
|
|
112
|
+
def __init__(self, sql: str) -> None:
|
|
113
|
+
self.sql = sql
|
|
114
|
+
self.statements: list[str] = []
|
|
115
|
+
self.current: list[str] = []
|
|
116
|
+
self.word: list[str] = []
|
|
117
|
+
self.state = ScanState.NORMAL
|
|
118
|
+
self.script_header = ScriptHeaderState.NONE
|
|
119
|
+
self.line_start = True
|
|
120
|
+
self.position = 0
|
|
121
|
+
|
|
122
|
+
def run(self) -> list[str]:
|
|
123
|
+
while self.position < len(self.sql):
|
|
124
|
+
self.consume_current_character()
|
|
125
|
+
|
|
126
|
+
self.finish_word()
|
|
127
|
+
self.flush_statement()
|
|
128
|
+
return self.statements
|
|
129
|
+
|
|
130
|
+
def consume_current_character(self) -> None:
|
|
131
|
+
if self.state == ScanState.NORMAL:
|
|
132
|
+
self.consume_normal()
|
|
133
|
+
elif self.state == ScanState.SCRIPT_BODY:
|
|
134
|
+
self.consume_script_body()
|
|
135
|
+
elif self.state == ScanState.SINGLE_QUOTE:
|
|
136
|
+
self.consume_quote("'")
|
|
137
|
+
elif self.state == ScanState.DOUBLE_QUOTE:
|
|
138
|
+
self.consume_quote('"')
|
|
139
|
+
elif self.state == ScanState.LINE_COMMENT:
|
|
140
|
+
self.consume_line_comment()
|
|
141
|
+
else:
|
|
142
|
+
self.consume_block_comment()
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def current_char(self) -> str:
|
|
146
|
+
return self.sql[self.position]
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
def next_char(self) -> str | None:
|
|
150
|
+
lookahead = self.position + 1
|
|
151
|
+
return self.sql[lookahead] if lookahead < len(self.sql) else None
|
|
152
|
+
|
|
153
|
+
def consume_normal(self) -> None:
|
|
154
|
+
if self.current_char.isalnum() or self.current_char == "_":
|
|
155
|
+
self.word.append(self.current_char)
|
|
156
|
+
self.append_current_char()
|
|
157
|
+
elif self.finish_word():
|
|
158
|
+
self.enter_script_body()
|
|
159
|
+
elif self.current_char == "'":
|
|
160
|
+
self.enter_state(ScanState.SINGLE_QUOTE)
|
|
161
|
+
elif self.current_char == '"':
|
|
162
|
+
self.enter_state(ScanState.DOUBLE_QUOTE)
|
|
163
|
+
elif self.current_char == "-" and self.next_char == "-":
|
|
164
|
+
self.enter_two_character_state(ScanState.LINE_COMMENT)
|
|
165
|
+
elif self.current_char == "/" and self.next_char == "*":
|
|
166
|
+
self.enter_two_character_state(ScanState.BLOCK_COMMENT)
|
|
167
|
+
elif self.current_char == ";":
|
|
168
|
+
self.script_header = ScriptHeaderState.NONE
|
|
169
|
+
self.flush_statement()
|
|
170
|
+
self.position += 1
|
|
171
|
+
else:
|
|
172
|
+
self.append_current_char()
|
|
173
|
+
|
|
174
|
+
def consume_script_body(self) -> None:
|
|
175
|
+
if self.slash_terminates_script_body():
|
|
176
|
+
self.finish_script_body()
|
|
177
|
+
return
|
|
178
|
+
|
|
179
|
+
self.current.append(self.current_char)
|
|
180
|
+
if self.current_char == "\n":
|
|
181
|
+
self.line_start = True
|
|
182
|
+
elif self.current_char not in " \t":
|
|
183
|
+
self.line_start = False
|
|
184
|
+
self.position += 1
|
|
185
|
+
|
|
186
|
+
def consume_quote(self, quote: str) -> None:
|
|
187
|
+
self.append_current_char()
|
|
188
|
+
if self.current[-1] == quote:
|
|
189
|
+
self.state = ScanState.NORMAL
|
|
190
|
+
|
|
191
|
+
def consume_line_comment(self) -> None:
|
|
192
|
+
self.append_current_char()
|
|
193
|
+
if self.current[-1] == "\n":
|
|
194
|
+
self.state = ScanState.NORMAL
|
|
195
|
+
|
|
196
|
+
def consume_block_comment(self) -> None:
|
|
197
|
+
next_char = self.next_char
|
|
198
|
+
self.current.append(self.current_char)
|
|
199
|
+
if self.current_char == "*" and next_char == "/":
|
|
200
|
+
self.current.append(next_char)
|
|
201
|
+
self.state = ScanState.NORMAL
|
|
202
|
+
self.position += 2
|
|
203
|
+
else:
|
|
204
|
+
self.position += 1
|
|
205
|
+
|
|
206
|
+
def enter_state(self, state: ScanState) -> None:
|
|
207
|
+
self.current.append(self.current_char)
|
|
208
|
+
self.state = state
|
|
209
|
+
self.position += 1
|
|
210
|
+
|
|
211
|
+
def enter_two_character_state(self, state: ScanState) -> None:
|
|
212
|
+
next_char = self.next_char
|
|
213
|
+
if next_char is None:
|
|
214
|
+
msg = "Expected two-character token while splitting SQL script."
|
|
215
|
+
raise ValueError(msg)
|
|
216
|
+
self.current.append(self.current_char)
|
|
217
|
+
self.current.append(next_char)
|
|
218
|
+
self.state = state
|
|
219
|
+
self.position += 2
|
|
220
|
+
|
|
221
|
+
def enter_script_body(self) -> None:
|
|
222
|
+
self.script_header = ScriptHeaderState.NONE
|
|
223
|
+
self.state = ScanState.SCRIPT_BODY
|
|
224
|
+
self.current.append(self.current_char)
|
|
225
|
+
self.line_start = self.current_char in " \t\n"
|
|
226
|
+
self.position += 1
|
|
227
|
+
|
|
228
|
+
def finish_script_body(self) -> None:
|
|
229
|
+
if self.current and self.current[-1] == "\n":
|
|
230
|
+
self.current.pop()
|
|
231
|
+
self.flush_statement()
|
|
232
|
+
self.script_header = ScriptHeaderState.NONE
|
|
233
|
+
self.state = ScanState.NORMAL
|
|
234
|
+
self.position += 1
|
|
235
|
+
self.skip_script_terminator_trailing_whitespace()
|
|
236
|
+
|
|
237
|
+
def skip_script_terminator_trailing_whitespace(self) -> None:
|
|
238
|
+
while self.position < len(self.sql) and self.current_char in " \t":
|
|
239
|
+
self.position += 1
|
|
240
|
+
if self.position < len(self.sql) and self.current_char == "\r":
|
|
241
|
+
self.position += 1
|
|
242
|
+
|
|
243
|
+
def append_current_char(self) -> None:
|
|
244
|
+
self.current.append(self.current_char)
|
|
245
|
+
self.position += 1
|
|
246
|
+
|
|
247
|
+
def flush_statement(self) -> None:
|
|
248
|
+
statement = "".join(self.current).strip()
|
|
249
|
+
if statement and strip_comments(statement).strip():
|
|
250
|
+
self.statements.append(statement)
|
|
251
|
+
self.current.clear()
|
|
252
|
+
|
|
253
|
+
def finish_word(self) -> bool:
|
|
254
|
+
if not self.word:
|
|
255
|
+
return False
|
|
256
|
+
|
|
257
|
+
upper_word = "".join(self.word).upper()
|
|
258
|
+
self.word.clear()
|
|
259
|
+
return self.update_script_header(upper_word)
|
|
260
|
+
|
|
261
|
+
def update_script_header(self, upper_word: str) -> bool:
|
|
262
|
+
if self.script_header == ScriptHeaderState.NONE:
|
|
263
|
+
self.update_empty_script_header(upper_word)
|
|
264
|
+
elif self.script_header == ScriptHeaderState.SAW_CREATE:
|
|
265
|
+
self.update_create_script_header(upper_word)
|
|
266
|
+
elif self.script_header == ScriptHeaderState.SAW_POSSIBLE_SCRIPT_LANGUAGE:
|
|
267
|
+
self.update_possible_language_script_header(upper_word)
|
|
268
|
+
elif self.script_header == ScriptHeaderState.SAW_SCRIPT_LANGUAGE:
|
|
269
|
+
self.update_language_script_header(upper_word)
|
|
270
|
+
elif upper_word == "AS":
|
|
271
|
+
return True
|
|
272
|
+
|
|
273
|
+
return False
|
|
274
|
+
|
|
275
|
+
def update_empty_script_header(self, upper_word: str) -> None:
|
|
276
|
+
if upper_word == "CREATE":
|
|
277
|
+
self.script_header = ScriptHeaderState.SAW_CREATE
|
|
278
|
+
|
|
279
|
+
def update_create_script_header(self, upper_word: str) -> None:
|
|
280
|
+
if upper_word == "SCRIPT":
|
|
281
|
+
self.script_header = ScriptHeaderState.SAW_SCRIPT
|
|
282
|
+
elif upper_word not in SCRIPT_HEADER_WORDS:
|
|
283
|
+
self.script_header = ScriptHeaderState.SAW_POSSIBLE_SCRIPT_LANGUAGE
|
|
284
|
+
|
|
285
|
+
def update_possible_language_script_header(self, upper_word: str) -> None:
|
|
286
|
+
if upper_word in SCRIPT_HEADER_WORDS:
|
|
287
|
+
self.script_header = ScriptHeaderState.SAW_SCRIPT_LANGUAGE
|
|
288
|
+
else:
|
|
289
|
+
self.script_header = ScriptHeaderState.NONE
|
|
290
|
+
|
|
291
|
+
def update_language_script_header(self, upper_word: str) -> None:
|
|
292
|
+
if upper_word == "SCRIPT":
|
|
293
|
+
self.script_header = ScriptHeaderState.SAW_SCRIPT
|
|
294
|
+
elif upper_word not in SCRIPT_HEADER_WORDS:
|
|
295
|
+
self.script_header = ScriptHeaderState.NONE
|
|
296
|
+
|
|
297
|
+
def slash_terminates_script_body(self) -> bool:
|
|
298
|
+
if not self.line_start or self.current_char != "/":
|
|
299
|
+
return False
|
|
300
|
+
|
|
301
|
+
lookahead = self.position + 1
|
|
302
|
+
while lookahead < len(self.sql) and self.sql[lookahead] in " \t":
|
|
303
|
+
lookahead += 1
|
|
304
|
+
|
|
305
|
+
if lookahead == len(self.sql) or self.sql[lookahead] == "\n":
|
|
306
|
+
return True
|
|
307
|
+
|
|
308
|
+
return self.sql[lookahead] == "\r" and (
|
|
309
|
+
lookahead + 1 == len(self.sql) or self.sql[lookahead + 1] == "\n"
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
def split_sql_script(sql: str) -> list[str]:
|
|
314
|
+
"""
|
|
315
|
+
Split an Exasol SQL script into executable statements.
|
|
316
|
+
|
|
317
|
+
The splitter is lexical, not a full SQL parser. It treats semicolons as
|
|
318
|
+
statement terminators except inside string literals, quoted identifiers,
|
|
319
|
+
line comments, block comments, and Exasol script bodies. Exasol script
|
|
320
|
+
bodies are entered after ``CREATE ... SCRIPT ... AS`` and are terminated by
|
|
321
|
+
a standalone ``/`` line.
|
|
322
|
+
"""
|
|
323
|
+
return _SqlScriptSplitter(sql).run()
|
|
@@ -36,6 +36,7 @@ from packaging.version import Version
|
|
|
36
36
|
from . import callback as cb
|
|
37
37
|
from . import constant
|
|
38
38
|
from ._metadata import __version__
|
|
39
|
+
from ._sql_splitter import split_sql_script
|
|
39
40
|
from .exceptions import (
|
|
40
41
|
ExaAuthError,
|
|
41
42
|
ExaCommunicationError,
|
|
@@ -332,6 +333,25 @@ class ExaConnection:
|
|
|
332
333
|
"""
|
|
333
334
|
return self.cls_statement(self, query, query_params)
|
|
334
335
|
|
|
336
|
+
def execute_sql_script(self, script: str) -> list[ExaStatement]:
|
|
337
|
+
"""
|
|
338
|
+
Execute a SQL script containing one or more statements.
|
|
339
|
+
|
|
340
|
+
The script is split into statements before execution. Semicolons inside
|
|
341
|
+
string literals, quoted SQL identifiers, line comments, block comments,
|
|
342
|
+
and Exasol script bodies do not terminate statements. Exasol script
|
|
343
|
+
bodies are terminated by a standalone ``/`` line.
|
|
344
|
+
|
|
345
|
+
Statements are executed sequentially using :meth:`execute`. The method
|
|
346
|
+
returns a list with one :class:`pyexasol.ExaStatement` for each executed
|
|
347
|
+
statement, in execution order. If one statement fails, the original
|
|
348
|
+
exception is raised and following statements are not executed.
|
|
349
|
+
|
|
350
|
+
Query parameters are intentionally not supported for SQL scripts.
|
|
351
|
+
Use :meth:`execute` for parameterized single statements.
|
|
352
|
+
"""
|
|
353
|
+
return [self.execute(statement) for statement in split_sql_script(script)]
|
|
354
|
+
|
|
335
355
|
def execute_udf_output(self, query: str, query_params: dict | None = None):
|
|
336
356
|
"""
|
|
337
357
|
Execute SQL query with UDF script, capture output
|
|
@@ -380,7 +380,7 @@ class ExaSQLExportThread(ExaSQLThread):
|
|
|
380
380
|
|
|
381
381
|
class ExaSQLImportThread(ExaSQLThread):
|
|
382
382
|
"""
|
|
383
|
-
Build and run
|
|
383
|
+
Build and run IMPORT query into separate thread
|
|
384
384
|
Main thread is busy parsing results in callbacks
|
|
385
385
|
"""
|
|
386
386
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyexasol"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.3.1"
|
|
4
4
|
description = "Exasol python driver with extra features"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Vitaly Markov", email = "wild.desu@gmail.com" },
|
|
@@ -26,6 +26,7 @@ classifiers = [
|
|
|
26
26
|
"Programming Language :: Python :: 3.11",
|
|
27
27
|
"Programming Language :: Python :: 3.12",
|
|
28
28
|
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Programming Language :: Python :: 3.14",
|
|
29
30
|
"Intended Audience :: Developers",
|
|
30
31
|
"Topic :: Database",
|
|
31
32
|
]
|
|
@@ -73,16 +74,16 @@ Homepage = "https://www.exasol.com/"
|
|
|
73
74
|
Documentation = "https://github.com/exasol/pyexasol/"
|
|
74
75
|
Source = "https://github.com/exasol/pyexasol"
|
|
75
76
|
Issues = "https://github.com/exasol/pyexasol/issues"
|
|
76
|
-
Changelog = "https://github.
|
|
77
|
+
Changelog = "https://exasol.github.io/pyexasol/master/changes/changelog.html"
|
|
77
78
|
|
|
78
79
|
[dependency-groups]
|
|
79
80
|
dev = [
|
|
80
81
|
"nox>=2023.4.22,<2024",
|
|
81
82
|
"pytest>=7.0.0,<10",
|
|
82
83
|
"docutils>=0.21.2,<0.22",
|
|
83
|
-
"exasol-integration-test-docker-environment>=
|
|
84
|
+
"exasol-integration-test-docker-environment>=6.4.1,<7",
|
|
84
85
|
"faker>=24.14.1,<25",
|
|
85
|
-
"exasol-toolbox>=10.
|
|
86
|
+
"exasol-toolbox>=10.4.0,<11",
|
|
86
87
|
"types-ujson>=5.10.0.20250326,<6",
|
|
87
88
|
"pytest-repeat>=0.9.4, <1.0.0",
|
|
88
89
|
"pandas-stubs>=2.3.3.251219,<3",
|
|
@@ -123,14 +124,9 @@ max-module-lines = 800
|
|
|
123
124
|
[[tool.mypy.overrides]]
|
|
124
125
|
module = [
|
|
125
126
|
# no stubs available as of 2025
|
|
126
|
-
"orjson.*",
|
|
127
|
-
"rapidjson.*",
|
|
128
127
|
"pyarrow.*",
|
|
129
128
|
"pyodbc.*",
|
|
130
129
|
"turbodbc.*",
|
|
131
|
-
# code we are not yet type checking
|
|
132
|
-
"examples.*",
|
|
133
|
-
"test.*"
|
|
134
130
|
]
|
|
135
131
|
ignore_errors = true
|
|
136
132
|
ignore_missing_imports = true
|
|
@@ -178,4 +174,6 @@ markers = [
|
|
|
178
174
|
"tls: tests related to tls.",
|
|
179
175
|
"transaction: tests related to transaction management.",
|
|
180
176
|
"udf: tests related to user defined functions.",
|
|
177
|
+
"with_cert: tests related to certificate verification.",
|
|
178
|
+
"no_cert: tests related to certificate verification disabled.",
|
|
181
179
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|