singlestoredb 1.1.0__cp38-abi3-win_amd64.whl → 1.3.0__cp38-abi3-win_amd64.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.

Files changed (32) hide show
  1. _singlestoredb_accel.pyd +0 -0
  2. singlestoredb/__init__.py +1 -1
  3. singlestoredb/config.py +6 -0
  4. singlestoredb/connection.py +23 -1
  5. singlestoredb/converters.py +390 -0
  6. singlestoredb/functions/ext/asgi.py +7 -1
  7. singlestoredb/fusion/handler.py +14 -8
  8. singlestoredb/fusion/handlers/stage.py +167 -84
  9. singlestoredb/fusion/handlers/workspace.py +250 -108
  10. singlestoredb/fusion/registry.py +27 -10
  11. singlestoredb/http/connection.py +18 -1
  12. singlestoredb/management/__init__.py +1 -0
  13. singlestoredb/management/organization.py +4 -0
  14. singlestoredb/management/utils.py +2 -2
  15. singlestoredb/management/workspace.py +79 -6
  16. singlestoredb/mysql/connection.py +92 -16
  17. singlestoredb/mysql/constants/EXTENDED_TYPE.py +3 -0
  18. singlestoredb/mysql/constants/FIELD_TYPE.py +16 -0
  19. singlestoredb/mysql/constants/VECTOR_TYPE.py +6 -0
  20. singlestoredb/mysql/cursors.py +13 -10
  21. singlestoredb/mysql/protocol.py +50 -1
  22. singlestoredb/notebook/__init__.py +15 -0
  23. singlestoredb/notebook/_objects.py +212 -0
  24. singlestoredb/tests/test.sql +49 -0
  25. singlestoredb/tests/test_connection.py +174 -0
  26. singlestoredb/utils/results.py +5 -1
  27. {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/METADATA +1 -1
  28. {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/RECORD +32 -28
  29. {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/LICENSE +0 -0
  30. {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/WHEEL +0 -0
  31. {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.0.dist-info}/entry_points.txt +0 -0
  32. {singlestoredb-1.1.0.dist-info → singlestoredb-1.3.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 ] [ at_path ] [ <like> ] [ <order-by> ]
16
- [ <limit> ] [ recursive ] [ extended ];
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
- Show the files in a workspace group's stage.
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
- * ``IN GROUP`` specifies the workspace group or workspace group ID.
43
- When using an ID, ``IN GROUP ID`` must be used.
44
- * ``AT PATH`` specifies the path to list. If no ``AT PATH`` is specified,
45
- the root directory is used.
46
- * ``LIKE`` allows you to specify a filename pattern using ``%`` as a wildcard.
47
- * ``ORDER BY`` allows you to specify the field to sort by.
48
- * ``LIMIT`` allows you to set a limit on the number of entries displayed.
49
- * ``RECURSIVE`` indicates that the stage should be listed recursively.
50
- * ``EXTENDED`` indicates that more detailed information should be displayed.
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
- Example 1: Show files at path
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
- Example 2: Show files recursively
75
+ SHOW STAGE FILES IN GROUP 'wsg1' AT PATH "/data/";
61
76
 
62
- This example show dow to display files recursively and with extra information::
77
+ The following command lists the files recursively with
78
+ additional information::
63
79
 
64
- SHOW STAGE FILES IN GROUP "My Group" RECURSIVE EXTENDED;
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 [ in_group ] FROM local_path [ overwrite ];
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
- Upload a file to the workspace group's stage.
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
- * ``<stage-path>`` is the path in stage to upload the file to.
145
- * ``IN GROUP`` specifies the workspace group or workspace group ID. When
146
- using an ID ``IN GROUP ID`` should be used.
147
- * ``<local-path>`` is the path on the local machine of the file to upload.
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
- Example 1: Upload with overwrite::
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 'My Group'
156
- FROM '/u/user/stats.csv' OVERWRITE;
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 [ in_group ] [ local_path ]
179
- [ overwrite ] [ encoding ];
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 stage file.
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
- * ``<stage-path>`` is the path in stage to download.
209
- * ``IN GROUP`` specifies the workspace group or workspace group ID. When
210
- using an ID ``IN GROUP ID`` should be used.
211
- * ``<local-path>`` is the destination path for the file. If not specified,
212
- the file is returned in a result set.
213
- * ``OVERWRITE`` indicates that an existing local file should be overwritten.
214
- * ``ENCODING`` specifies the encoding of the file to apply to the downloaded
215
- file. By default, files are downloaded as binary. This only option
216
- typically only matters if ``<local-path>`` is not specified and the file
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
- Example 1: Print a file to the screen::
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 'My Group';
270
+ DOWNLOAD STAGE FILE '/data/stats.csv' IN GROUP 'wsgroup1' ENCODING 'utf8';
224
271
 
225
- Example 2: Download a file to a local path with overwrite set::
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
- DONLOAD STAGE FILE '/data/stats.csv' IN GROUP 'My Group'
228
- TO '/u/me/data.csv' OVERWRITE;
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 [ in_group ];
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
- Drop a stage file.
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
- * ``<stage-path>`` is the path in stage to drop.
284
- * ``IN GROUP`` specifies the workspace group or workspace group ID. When
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
- Drop a specific file from stage::
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 'My 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 [ in_group ] [ recursive ];
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
- Drop a folder from stage.
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
- * ``<stage-path>`` is the path in stage to drop.
334
- * ``IN GROUP`` specifies the workspace group or workspace group ID. When
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
- Drop a folder recursively::
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 'My Group' RECURSIVE;
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 [ in_group ] [ overwrite ];
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
- Create a folder in stage.
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
- * ``<stage-path>`` is the path to create in stage.
388
- * ``IN GROUP`` specifies the workspace group or workspace group ID. When
389
- using an ID ``IN GROUP ID`` should be used.
390
- * ``OVERWRITE`` indicates that an existing folder should be overwritten
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
- Create a folder::
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 'My Group';
480
+ CREATE STAGE FOLDER `/data/csv/` IN GROUP 'wsg1';
398
481
 
399
482
  """
400
483