singlestoredb 1.1.0__cp38-abi3-win32.whl → 1.2.0__cp38-abi3-win32.whl
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.
Potentially problematic release.
This version of singlestoredb might be problematic. Click here for more details.
- _singlestoredb_accel.pyd +0 -0
- singlestoredb/__init__.py +1 -1
- singlestoredb/config.py +6 -0
- singlestoredb/connection.py +3 -0
- singlestoredb/converters.py +390 -0
- singlestoredb/functions/ext/asgi.py +7 -1
- singlestoredb/fusion/handler.py +14 -8
- singlestoredb/fusion/handlers/stage.py +167 -84
- singlestoredb/fusion/handlers/workspace.py +250 -108
- singlestoredb/fusion/registry.py +27 -10
- singlestoredb/management/__init__.py +1 -0
- singlestoredb/management/organization.py +4 -0
- singlestoredb/management/utils.py +2 -2
- singlestoredb/management/workspace.py +79 -6
- singlestoredb/mysql/connection.py +12 -0
- singlestoredb/mysql/constants/EXTENDED_TYPE.py +3 -0
- singlestoredb/mysql/constants/FIELD_TYPE.py +16 -0
- singlestoredb/mysql/constants/VECTOR_TYPE.py +6 -0
- singlestoredb/mysql/cursors.py +5 -4
- singlestoredb/mysql/protocol.py +50 -1
- singlestoredb/notebook/__init__.py +15 -0
- singlestoredb/notebook/_objects.py +212 -0
- singlestoredb/tests/test.sql +49 -0
- singlestoredb/tests/test_connection.py +174 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.2.0.dist-info}/METADATA +1 -1
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.2.0.dist-info}/RECORD +30 -26
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.2.0.dist-info}/LICENSE +0 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.2.0.dist-info}/WHEEL +0 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.2.0.dist-info}/entry_points.txt +0 -0
- {singlestoredb-1.1.0.dist-info → singlestoredb-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -12,8 +12,10 @@ from .utils import get_workspace_group
|
|
|
12
12
|
|
|
13
13
|
class ShowStageFilesHandler(SQLHandler):
|
|
14
14
|
"""
|
|
15
|
-
SHOW STAGE FILES [ in_group ]
|
|
16
|
-
|
|
15
|
+
SHOW STAGE FILES [ in_group ]
|
|
16
|
+
[ at_path ] [ <like> ]
|
|
17
|
+
[ <order-by> ]
|
|
18
|
+
[ <limit> ] [ recursive ] [ extended ];
|
|
17
19
|
|
|
18
20
|
# Workspace group
|
|
19
21
|
in_group = IN GROUP { group_id | group_name }
|
|
@@ -35,40 +37,54 @@ class ShowStageFilesHandler(SQLHandler):
|
|
|
35
37
|
|
|
36
38
|
Description
|
|
37
39
|
-----------
|
|
38
|
-
|
|
40
|
+
Displays a list of files in a Stage.
|
|
41
|
+
|
|
42
|
+
Refer to `Stage <https://docs.singlestore.com/cloud/developer-resources/stage-storage-service/>`_
|
|
43
|
+
for more information.
|
|
44
|
+
|
|
45
|
+
Arguments
|
|
46
|
+
---------
|
|
47
|
+
* ``<group_id>``: The ID of the workspace group in which
|
|
48
|
+
the Stage is attached.
|
|
49
|
+
* ``<group_name>``: The name of the workspace group in which
|
|
50
|
+
the Stage is attached.
|
|
51
|
+
* ``<path>``: A path in the Stage.
|
|
52
|
+
* ``<pattern>``: A pattern similar to SQL LIKE clause.
|
|
53
|
+
Uses ``%`` as the wildcard character.
|
|
39
54
|
|
|
40
55
|
Remarks
|
|
41
56
|
-------
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
* ``
|
|
47
|
-
|
|
48
|
-
* ``
|
|
49
|
-
|
|
50
|
-
* ``
|
|
57
|
+
* Use the ``LIKE`` clause to specify a pattern and return only the
|
|
58
|
+
files that match the specified pattern.
|
|
59
|
+
* The ``LIMIT`` clause limits the number of results to the
|
|
60
|
+
specified number.
|
|
61
|
+
* Use the ``ORDER BY`` clause to sort the results by the specified
|
|
62
|
+
key. By default, the results are sorted in the ascending order.
|
|
63
|
+
* The ``AT PATH`` clause specifies the path in the Stage to list
|
|
64
|
+
the files from.
|
|
65
|
+
* The ``IN GROUP`` clause specifies the ID or the name of the
|
|
66
|
+
workspace group in which the Stage is attached.
|
|
67
|
+
* Use the ``RECURSIVE`` clause to list the files recursively.
|
|
68
|
+
* To return more information about the files, use the ``EXTENDED``
|
|
69
|
+
clause.
|
|
51
70
|
|
|
52
71
|
Examples
|
|
53
72
|
--------
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
This example shows how to list files starting at a specific path::
|
|
57
|
-
|
|
58
|
-
SHOW STAGE FILES IN GROUP "My Group" AT PATH "/data/";
|
|
73
|
+
The following command lists the files at a specific path::
|
|
59
74
|
|
|
60
|
-
|
|
75
|
+
SHOW STAGE FILES IN GROUP 'wsg1' AT PATH "/data/";
|
|
61
76
|
|
|
62
|
-
|
|
77
|
+
The following command lists the files recursively with
|
|
78
|
+
additional information::
|
|
63
79
|
|
|
64
|
-
SHOW STAGE FILES IN GROUP
|
|
80
|
+
SHOW STAGE FILES IN GROUP 'wsg1' RECURSIVE EXTENDED;
|
|
65
81
|
|
|
66
82
|
See Also
|
|
67
83
|
--------
|
|
68
|
-
* UPLOAD FILE TO STAGE
|
|
69
|
-
* DOWNLOAD STAGE FILE
|
|
84
|
+
* ``UPLOAD FILE TO STAGE``
|
|
85
|
+
* ``DOWNLOAD STAGE FILE``
|
|
70
86
|
|
|
71
|
-
"""
|
|
87
|
+
""" # noqa: E501
|
|
72
88
|
|
|
73
89
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
74
90
|
wg = get_workspace_group(params)
|
|
@@ -115,7 +131,9 @@ ShowStageFilesHandler.register(overwrite=True)
|
|
|
115
131
|
|
|
116
132
|
class UploadStageFileHandler(SQLHandler):
|
|
117
133
|
"""
|
|
118
|
-
UPLOAD FILE TO STAGE stage_path
|
|
134
|
+
UPLOAD FILE TO STAGE stage_path
|
|
135
|
+
[ in_group ]
|
|
136
|
+
FROM local_path [ overwrite ];
|
|
119
137
|
|
|
120
138
|
# Path to stage file
|
|
121
139
|
stage_path = '<stage-path>'
|
|
@@ -137,29 +155,41 @@ class UploadStageFileHandler(SQLHandler):
|
|
|
137
155
|
|
|
138
156
|
Description
|
|
139
157
|
-----------
|
|
140
|
-
|
|
158
|
+
Uploads a file to a Stage.
|
|
159
|
+
|
|
160
|
+
Refer to `Stage <https://docs.singlestore.com/cloud/developer-resources/stage-storage-service/>`_
|
|
161
|
+
for more information.
|
|
162
|
+
|
|
163
|
+
Arguments
|
|
164
|
+
---------
|
|
165
|
+
* ``<stage_path>``: The path in the Stage where the file is uploaded.
|
|
166
|
+
* ``<group_id>``: The ID of the workspace group in which the Stage
|
|
167
|
+
is attached.
|
|
168
|
+
* ``<group_name>``: The name of the workspace group in which the
|
|
169
|
+
Stage is attached.
|
|
170
|
+
* ``<local-path>``: The path to the file to upload in the local
|
|
171
|
+
directory.
|
|
141
172
|
|
|
142
173
|
Remarks
|
|
143
174
|
-------
|
|
144
|
-
*
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
* ``OVERWRITE`` indicates that an existing stage file at that path
|
|
149
|
-
should be overwritten if it exists.
|
|
175
|
+
* The ``IN GROUP`` clause specifies the ID or the name of the workspace
|
|
176
|
+
group in which the Stage is attached.
|
|
177
|
+
* If the ``OVERWRITE`` clause is specified, any existing file at the
|
|
178
|
+
specified path in the Stage is overwritten.
|
|
150
179
|
|
|
151
180
|
Examples
|
|
152
181
|
--------
|
|
153
|
-
|
|
182
|
+
The following command uploads a file to a Stage and overwrites any
|
|
183
|
+
existing files at the specified path::
|
|
154
184
|
|
|
155
|
-
UPLOAD FILE TO STAGE '/data/stats.csv' IN GROUP '
|
|
156
|
-
|
|
185
|
+
UPLOAD FILE TO STAGE '/data/stats.csv' IN GROUP 'wsg1'
|
|
186
|
+
FROM '/tmp/user/stats.csv' OVERWRITE;
|
|
157
187
|
|
|
158
188
|
See Also
|
|
159
189
|
--------
|
|
160
|
-
* DOWNLOAD STAGE FILE
|
|
190
|
+
* ``DOWNLOAD STAGE FILE``
|
|
161
191
|
|
|
162
|
-
"""
|
|
192
|
+
""" # noqa: E501
|
|
163
193
|
|
|
164
194
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
165
195
|
wg = get_workspace_group(params)
|
|
@@ -175,8 +205,11 @@ UploadStageFileHandler.register(overwrite=True)
|
|
|
175
205
|
|
|
176
206
|
class DownloadStageFileHandler(SQLHandler):
|
|
177
207
|
"""
|
|
178
|
-
DOWNLOAD STAGE FILE stage_path
|
|
179
|
-
|
|
208
|
+
DOWNLOAD STAGE FILE stage_path
|
|
209
|
+
[ in_group ]
|
|
210
|
+
[ local_path ]
|
|
211
|
+
[ overwrite ]
|
|
212
|
+
[ encoding ];
|
|
180
213
|
|
|
181
214
|
# Path to stage file
|
|
182
215
|
stage_path = '<stage-path>'
|
|
@@ -201,37 +234,52 @@ class DownloadStageFileHandler(SQLHandler):
|
|
|
201
234
|
|
|
202
235
|
Description
|
|
203
236
|
-----------
|
|
204
|
-
Download a
|
|
237
|
+
Download a file from a Stage.
|
|
238
|
+
|
|
239
|
+
Refer to `Stage <https://docs.singlestore.com/cloud/developer-resources/stage-storage-service/>`_
|
|
240
|
+
for more information.
|
|
241
|
+
|
|
242
|
+
Arguments
|
|
243
|
+
---------
|
|
244
|
+
* ``<stage_path>``: The path to the file to download in a Stage.
|
|
245
|
+
* ``<group_id>``: The ID of the workspace group in which the
|
|
246
|
+
Stage is attached.
|
|
247
|
+
* ``<group_name>``: The name of the workspace group in which the
|
|
248
|
+
Stage is attached.
|
|
249
|
+
* ``<encoding>``: The encoding to apply to the downloaded file.
|
|
250
|
+
* ``<local-path>``: Specifies the path in the local directory
|
|
251
|
+
where the file is downloaded.
|
|
205
252
|
|
|
206
253
|
Remarks
|
|
207
254
|
-------
|
|
208
|
-
*
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
is to be printed to the screen.
|
|
255
|
+
* If the ``OVERWRITE`` clause is specified, any existing file at
|
|
256
|
+
the download location is overwritten.
|
|
257
|
+
* The ``IN GROUP`` clause specifies the ID or the name of the
|
|
258
|
+
workspace group in which the Stage is attached.
|
|
259
|
+
* By default, files are downloaded in binary encoding. To view
|
|
260
|
+
the contents of the file on the standard output, use the
|
|
261
|
+
``ENCODING`` clause and specify an encoding.
|
|
262
|
+
* If ``<local-path>`` is not specified, the file is displayed
|
|
263
|
+
on the standard output.
|
|
218
264
|
|
|
219
265
|
Examples
|
|
220
266
|
--------
|
|
221
|
-
|
|
267
|
+
The following command displays the contents of the file on the
|
|
268
|
+
standard output::
|
|
222
269
|
|
|
223
|
-
DOWNLOAD STAGE FILE '/data/stats.csv' IN GROUP '
|
|
270
|
+
DOWNLOAD STAGE FILE '/data/stats.csv' IN GROUP 'wsgroup1' ENCODING 'utf8';
|
|
224
271
|
|
|
225
|
-
|
|
272
|
+
The following command downloads a file to a specific location and
|
|
273
|
+
overwrites any existing file with the name ``stats.csv`` on the local storage::
|
|
226
274
|
|
|
227
|
-
|
|
228
|
-
|
|
275
|
+
DOWNLOAD STAGE FILE '/data/stats.csv' IN GROUP 'wsgroup1'
|
|
276
|
+
TO '/tmp/data.csv' OVERWRITE;
|
|
229
277
|
|
|
230
278
|
See Also
|
|
231
279
|
--------
|
|
232
|
-
* UPLOAD FILE TO STAGE
|
|
280
|
+
* ``UPLOAD FILE TO STAGE``
|
|
233
281
|
|
|
234
|
-
"""
|
|
282
|
+
""" # noqa: E501
|
|
235
283
|
|
|
236
284
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
237
285
|
wg = get_workspace_group(params)
|
|
@@ -260,7 +308,8 @@ DownloadStageFileHandler.register(overwrite=True)
|
|
|
260
308
|
|
|
261
309
|
class DropStageFileHandler(SQLHandler):
|
|
262
310
|
"""
|
|
263
|
-
DROP STAGE FILE stage_path
|
|
311
|
+
DROP STAGE FILE stage_path
|
|
312
|
+
[ in_group ];
|
|
264
313
|
|
|
265
314
|
# Path to stage file
|
|
266
315
|
stage_path = '<stage-path>'
|
|
@@ -276,25 +325,36 @@ class DropStageFileHandler(SQLHandler):
|
|
|
276
325
|
|
|
277
326
|
Description
|
|
278
327
|
-----------
|
|
279
|
-
|
|
328
|
+
Deletes a file from a Stage.
|
|
329
|
+
|
|
330
|
+
Refer to `Stage <https://docs.singlestore.com/cloud/developer-resources/stage-storage-service/>`_
|
|
331
|
+
for more information.
|
|
332
|
+
|
|
333
|
+
Arguments
|
|
334
|
+
---------
|
|
335
|
+
* ``<stage_path>``: The path to the file to delete in a Stage.
|
|
336
|
+
* ``<group_id>``: The ID of the workspace group in which the
|
|
337
|
+
Stage is attached.
|
|
338
|
+
* ``<group_name>``: The name of the workspace group in which
|
|
339
|
+
the Stage is attached.
|
|
280
340
|
|
|
281
341
|
Remarks
|
|
282
342
|
-------
|
|
283
|
-
*
|
|
284
|
-
|
|
285
|
-
using an ID ``IN GROUP ID`` should be used.
|
|
343
|
+
* The ``IN GROUP`` clause specifies the ID or the name of the
|
|
344
|
+
workspace group in which the Stage is attached.
|
|
286
345
|
|
|
287
346
|
Example
|
|
288
347
|
--------
|
|
289
|
-
|
|
348
|
+
The following command deletes a file from a Stage attached to
|
|
349
|
+
a workspace group named **wsg1**::
|
|
290
350
|
|
|
291
|
-
DROP STAGE FILE '/data/stats.csv' IN GROUP '
|
|
351
|
+
DROP STAGE FILE '/data/stats.csv' IN GROUP 'wsg1';
|
|
292
352
|
|
|
293
353
|
See Also
|
|
294
354
|
--------
|
|
295
|
-
* DROP STAGE FOLDER
|
|
355
|
+
* ``DROP STAGE FOLDER``
|
|
296
356
|
|
|
297
|
-
"""
|
|
357
|
+
""" # noqa: E501
|
|
298
358
|
|
|
299
359
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
300
360
|
wg = get_workspace_group(params)
|
|
@@ -307,7 +367,9 @@ DropStageFileHandler.register(overwrite=True)
|
|
|
307
367
|
|
|
308
368
|
class DropStageFolderHandler(SQLHandler):
|
|
309
369
|
"""
|
|
310
|
-
DROP STAGE FOLDER stage_path
|
|
370
|
+
DROP STAGE FOLDER stage_path
|
|
371
|
+
[ in_group ]
|
|
372
|
+
[ recursive ];
|
|
311
373
|
|
|
312
374
|
# Path to stage folder
|
|
313
375
|
stage_path = '<stage-path>'
|
|
@@ -326,26 +388,36 @@ class DropStageFolderHandler(SQLHandler):
|
|
|
326
388
|
|
|
327
389
|
Description
|
|
328
390
|
-----------
|
|
329
|
-
|
|
391
|
+
Deletes a folder from a Stage.
|
|
392
|
+
|
|
393
|
+
Refer to `Stage <https://docs.singlestore.com/cloud/developer-resources/stage-storage-service/>`_
|
|
394
|
+
for more information.
|
|
395
|
+
|
|
396
|
+
Arguments
|
|
397
|
+
---------
|
|
398
|
+
* ``<stage_path>``: The path to the folder to delete in a Stage.
|
|
399
|
+
* ``<group_id>``: The ID of the workspace group in which the
|
|
400
|
+
Stage is attached.
|
|
401
|
+
* ``<group_name>``: The name of the workspace group in which the
|
|
402
|
+
Stage is attached.
|
|
330
403
|
|
|
331
404
|
Remarks
|
|
332
405
|
-------
|
|
333
|
-
*
|
|
334
|
-
|
|
335
|
-
using an ID ``IN GROUP ID`` should be used.
|
|
336
|
-
* ``RECURSIVE`` indicates that folders should be removed recursively.
|
|
406
|
+
* The ``RECURSIVE`` clause indicates that the specified folder
|
|
407
|
+
is deleted recursively.
|
|
337
408
|
|
|
338
409
|
Example
|
|
339
410
|
-------
|
|
340
|
-
|
|
411
|
+
The following command recursively deletes a folder from a Stage
|
|
412
|
+
attached to a workspace group named **wsg1**::
|
|
341
413
|
|
|
342
|
-
DROP STAGE FOLDER '/data/' IN GROUP '
|
|
414
|
+
DROP STAGE FOLDER '/data/' IN GROUP 'wsg1' RECURSIVE;
|
|
343
415
|
|
|
344
416
|
See Also
|
|
345
417
|
--------
|
|
346
|
-
* DROP STAGE FILE
|
|
418
|
+
* ``DROP STAGE FILE``
|
|
347
419
|
|
|
348
|
-
"""
|
|
420
|
+
""" # noqa: E501
|
|
349
421
|
|
|
350
422
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
351
423
|
wg = get_workspace_group(params)
|
|
@@ -361,7 +433,9 @@ DropStageFolderHandler.register(overwrite=True)
|
|
|
361
433
|
|
|
362
434
|
class CreateStageFolderHandler(SQLHandler):
|
|
363
435
|
"""
|
|
364
|
-
CREATE STAGE FOLDER stage_path
|
|
436
|
+
CREATE STAGE FOLDER stage_path
|
|
437
|
+
[ in_group ]
|
|
438
|
+
[ overwrite ];
|
|
365
439
|
|
|
366
440
|
# Workspace group
|
|
367
441
|
in_group = IN GROUP { group_id | group_name }
|
|
@@ -380,21 +454,30 @@ class CreateStageFolderHandler(SQLHandler):
|
|
|
380
454
|
|
|
381
455
|
Description
|
|
382
456
|
-----------
|
|
383
|
-
|
|
457
|
+
Creates a new folder at the specified path in a Stage.
|
|
458
|
+
|
|
459
|
+
Arguments
|
|
460
|
+
---------
|
|
461
|
+
* ``<stage_path>``: The path in a Stage where the folder
|
|
462
|
+
is created. The path must end with a trailing slash (/).
|
|
463
|
+
* ``<group_id>``: The ID of the workspace group in which
|
|
464
|
+
the Stage is attached.
|
|
465
|
+
* ``<group_name>``: The name of the workspace group in
|
|
466
|
+
which the Stage is attached.
|
|
384
467
|
|
|
385
468
|
Remarks
|
|
386
469
|
-------
|
|
387
|
-
*
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
with a new folder.
|
|
470
|
+
* If the ``OVERWRITE`` clause is specified, any existing
|
|
471
|
+
folder at the specified path is overwritten.
|
|
472
|
+
* The ``IN GROUP`` clause specifies the ID or the name of
|
|
473
|
+
the workspace group in which the Stage is attached.
|
|
392
474
|
|
|
393
475
|
Example
|
|
394
476
|
-------
|
|
395
|
-
|
|
477
|
+
The following command creates a folder in a Stage attached
|
|
478
|
+
to a workspace group named **wsg1**::
|
|
396
479
|
|
|
397
|
-
CREATE STAGE FOLDER `/data/csv/` IN GROUP '
|
|
480
|
+
CREATE STAGE FOLDER `/data/csv/` IN GROUP 'wsg1';
|
|
398
481
|
|
|
399
482
|
"""
|
|
400
483
|
|