singlestoredb 0.10.1__cp38-abi3-macosx_10_9_universal2.whl → 0.10.2__cp38-abi3-macosx_10_9_universal2.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.abi3.so +0 -0
- singlestoredb/__init__.py +1 -1
- singlestoredb/fusion/handlers/utils.py +20 -4
- singlestoredb/fusion/handlers/workspace.py +21 -15
- {singlestoredb-0.10.1.dist-info → singlestoredb-0.10.2.dist-info}/METADATA +1 -1
- {singlestoredb-0.10.1.dist-info → singlestoredb-0.10.2.dist-info}/RECORD +9 -9
- {singlestoredb-0.10.1.dist-info → singlestoredb-0.10.2.dist-info}/LICENSE +0 -0
- {singlestoredb-0.10.1.dist-info → singlestoredb-0.10.2.dist-info}/WHEEL +0 -0
- {singlestoredb-0.10.1.dist-info → singlestoredb-0.10.2.dist-info}/top_level.txt +0 -0
_singlestoredb_accel.abi3.so
CHANGED
|
Binary file
|
singlestoredb/__init__.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
import datetime
|
|
3
|
+
import os
|
|
3
4
|
from typing import Any
|
|
4
5
|
from typing import Dict
|
|
5
6
|
from typing import Optional
|
|
@@ -26,15 +27,17 @@ def get_workspace_group(params: Dict[str, Any]) -> WorkspaceGroup:
|
|
|
26
27
|
"""Find a workspace group matching group_id or group_name."""
|
|
27
28
|
manager = get_workspace_manager()
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
group_name = params.get('group_name') or \
|
|
31
|
+
(params.get('in_group') or {}).get('group_name')
|
|
32
|
+
if group_name:
|
|
30
33
|
workspace_groups = [
|
|
31
34
|
x for x in manager.workspace_groups
|
|
32
|
-
if x.name ==
|
|
35
|
+
if x.name == group_name
|
|
33
36
|
]
|
|
34
37
|
|
|
35
38
|
if not workspace_groups:
|
|
36
39
|
raise KeyError(
|
|
37
|
-
'no workspace group found with name "{}"'.format(
|
|
40
|
+
'no workspace group found with name "{}"'.format(group_name),
|
|
38
41
|
)
|
|
39
42
|
|
|
40
43
|
if len(workspace_groups) > 1:
|
|
@@ -45,4 +48,17 @@ def get_workspace_group(params: Dict[str, Any]) -> WorkspaceGroup:
|
|
|
45
48
|
|
|
46
49
|
return workspace_groups[0]
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
group_id = params.get('group_id') or \
|
|
52
|
+
(params.get('in_group') or {}).get('group_id')
|
|
53
|
+
if group_id:
|
|
54
|
+
return manager.get_workspace_group(group_id)
|
|
55
|
+
|
|
56
|
+
if os.environ.get('SINGLESTOREDB_WORKSPACE_GROUP'):
|
|
57
|
+
return manager.get_workspace_group(
|
|
58
|
+
os.environ['SINGLESTOREDB_WORKSPACE_GROUP'],
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if os.environ.get('SINGLESTOREDB_CLUSTER'):
|
|
62
|
+
raise ValueError('clusters and shared workspaces are not currently supported')
|
|
63
|
+
|
|
64
|
+
raise KeyError('no workspace group was specified')
|
|
@@ -80,8 +80,10 @@ ShowWorkspaceGroupsHandler.register()
|
|
|
80
80
|
|
|
81
81
|
class ShowWorkspacesHandler(SQLHandler):
|
|
82
82
|
"""
|
|
83
|
-
SHOW WORKSPACES
|
|
84
|
-
|
|
83
|
+
SHOW WORKSPACES [ in_group ] [ <like> ] [ <extended> ] [ <order-by> ] [ <limit> ];
|
|
84
|
+
|
|
85
|
+
# Workspace group
|
|
86
|
+
in_group = IN GROUP { group_id | group_name }
|
|
85
87
|
|
|
86
88
|
# ID of group
|
|
87
89
|
group_id = ID '<group-id>'
|
|
@@ -198,10 +200,12 @@ CreateWorkspaceGroupHandler.register()
|
|
|
198
200
|
|
|
199
201
|
class CreateWorkspaceHandler(SQLHandler):
|
|
200
202
|
"""
|
|
201
|
-
CREATE WORKSPACE [ if_not_exists ] workspace_name
|
|
202
|
-
IN GROUP { group_id | group_name }
|
|
203
|
+
CREATE WORKSPACE [ if_not_exists ] workspace_name [ in_group ]
|
|
203
204
|
WITH SIZE size [ wait_on_active ];
|
|
204
205
|
|
|
206
|
+
# Create workspace in workspace group
|
|
207
|
+
in_group = IN GROUP { group_id | group_name }
|
|
208
|
+
|
|
205
209
|
# Only run command if workspace doesn't already exist
|
|
206
210
|
if_not_exists = IF NOT EXISTS
|
|
207
211
|
|
|
@@ -264,15 +268,15 @@ class DropWorkspaceGroupHandler(SQLHandler):
|
|
|
264
268
|
"""
|
|
265
269
|
|
|
266
270
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
267
|
-
manager = get_workspace_manager()
|
|
268
|
-
|
|
269
271
|
try:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
workspace_group = get_workspace_group(params)
|
|
273
|
+
if workspace_group.terminated_at is not None:
|
|
274
|
+
raise KeyError
|
|
275
|
+
workspace_group.terminate(wait_on_terminated=params['wait_on_terminated'])
|
|
273
276
|
|
|
274
277
|
except KeyError:
|
|
275
278
|
if not params['if_exists']:
|
|
279
|
+
name_or_id = params['group_id'] or params['group_name']
|
|
276
280
|
raise KeyError(f"could not find workspace group '{name_or_id}'")
|
|
277
281
|
|
|
278
282
|
return None
|
|
@@ -284,7 +288,10 @@ DropWorkspaceGroupHandler.register()
|
|
|
284
288
|
class DropWorkspaceHandler(SQLHandler):
|
|
285
289
|
"""
|
|
286
290
|
DROP WORKSPACE [ if_exists ] { workspace_id | workspace_name }
|
|
287
|
-
|
|
291
|
+
[ in_group ] [ wait_on_terminated ];
|
|
292
|
+
|
|
293
|
+
# Workspace group
|
|
294
|
+
in_group = IN GROUP { group_id | group_name }
|
|
288
295
|
|
|
289
296
|
# Only drop workspace if it exists
|
|
290
297
|
if_exists = IF EXISTS
|
|
@@ -307,16 +314,15 @@ class DropWorkspaceHandler(SQLHandler):
|
|
|
307
314
|
"""
|
|
308
315
|
|
|
309
316
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
310
|
-
manager = get_workspace_manager()
|
|
311
|
-
|
|
312
317
|
try:
|
|
318
|
+
workspace_group = get_workspace_group(params)
|
|
313
319
|
workspace_name_or_id = params['workspace_name'] or params['workspace_id']
|
|
314
|
-
|
|
315
|
-
wg = manager.workspace_groups[group_name_or_id]
|
|
316
|
-
ws = wg.workspaces[workspace_name_or_id]
|
|
320
|
+
ws = workspace_group.workspaces[workspace_name_or_id]
|
|
317
321
|
ws.terminate(wait_on_terminated=params['wait_on_terminated'])
|
|
318
322
|
|
|
319
323
|
except KeyError:
|
|
324
|
+
group_name_or_id = params['in_group'].get('group_id', None) or \
|
|
325
|
+
params['in_group'].get('group_name', None)
|
|
320
326
|
if not params['if_exists']:
|
|
321
327
|
raise KeyError(
|
|
322
328
|
f"could not find workspace '{workspace_name_or_id}' "
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
_singlestoredb_accel.abi3.so,sha256
|
|
2
|
-
singlestoredb-0.10.
|
|
3
|
-
singlestoredb-0.10.
|
|
4
|
-
singlestoredb-0.10.
|
|
5
|
-
singlestoredb-0.10.
|
|
6
|
-
singlestoredb-0.10.
|
|
1
|
+
_singlestoredb_accel.abi3.so,sha256=-6OnNeHuiNB34MvOOTPJkJSNUYBBk9nZ8V8bvlpPviE,190381
|
|
2
|
+
singlestoredb-0.10.2.dist-info/RECORD,,
|
|
3
|
+
singlestoredb-0.10.2.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
|
|
4
|
+
singlestoredb-0.10.2.dist-info/WHEEL,sha256=KJyRfI6ymNrbNX24abM8L1lvGQoLJMtVQA9ah4jJdY4,113
|
|
5
|
+
singlestoredb-0.10.2.dist-info/top_level.txt,sha256=SDtemIXf-Kp-_F2f_S6x0db33cHGOILdAEsIQZe2LZc,35
|
|
6
|
+
singlestoredb-0.10.2.dist-info/METADATA,sha256=AIiNHizIrmtM6tIi3t2FTOO_HlNBK4vgrYfXjXBHx3s,7639
|
|
7
7
|
singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
|
|
8
8
|
singlestoredb/config.py,sha256=ZfLiOeqADAUMekvA9OZoDWDLdvXTGebPOcmMnN33Drw,7476
|
|
9
|
-
singlestoredb/__init__.py,sha256=
|
|
9
|
+
singlestoredb/__init__.py,sha256=k9Blt_QRyqz6gOVAJZEMHpMi_Yh_jjUhWYGOxfoo2e8,878
|
|
10
10
|
singlestoredb/types.py,sha256=FIqO1A7e0Gkk7ITmIysBy-P5S--ItbMSlYvblzqGS30,9969
|
|
11
11
|
singlestoredb/connection.py,sha256=gDBIs3XgLOROVHtzMx9zmSYILc0aRVY7k8we3b4TxCw,44227
|
|
12
12
|
singlestoredb/exceptions.py,sha256=HuoA6sMRL5qiCiee-_5ddTGmFbYC9Euk8TYUsh5GvTw,3234
|
|
@@ -17,9 +17,9 @@ singlestoredb/fusion/registry.py,sha256=rbt-3WITO0aLC3ylDlY7FBlzA9-kmTBbW6-LQyVI
|
|
|
17
17
|
singlestoredb/fusion/__init__.py,sha256=Qo7SuqGw-l-vE8-EI2jhm6hXJkYfOLUKIws9c7LFNX0,356
|
|
18
18
|
singlestoredb/fusion/result.py,sha256=Bd3KbRpqWqQcWp_Chd4bzBy8Kfc8nXLS_Pn_GGbPO6o,11772
|
|
19
19
|
singlestoredb/fusion/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
singlestoredb/fusion/handlers/utils.py,sha256=
|
|
20
|
+
singlestoredb/fusion/handlers/utils.py,sha256=QMgflQFTGz1ltTTJR50XfY2GZdHbjUTKUB5SWM7S6UE,1981
|
|
21
21
|
singlestoredb/fusion/handlers/stage.py,sha256=LL_C-yz8X6mjvseFmY_EmDLzxOMJqm6pvvYIUh7HXjc,5234
|
|
22
|
-
singlestoredb/fusion/handlers/workspace.py,sha256=
|
|
22
|
+
singlestoredb/fusion/handlers/workspace.py,sha256=pyEqD5nbu0BRE0-DfiW3O6WhbJHaVaAQJzkHnVUozfs,9710
|
|
23
23
|
singlestoredb/tests/test.sql,sha256=wtHioW6SNa2nht71Bo9XQkE36-X1L6C_AZ5QyMJuvqM,9415
|
|
24
24
|
singlestoredb/tests/test_xdict.py,sha256=fqHspoi39nbX3fIDVkkRXcd5H50xdOsSvK0bxAMQnaE,10408
|
|
25
25
|
singlestoredb/tests/test_results.py,sha256=wg93sujwt-R9_eJCgSCElgAZhLDkIiAo3qPkPydOv78,6582
|
|
File without changes
|
|
File without changes
|
|
File without changes
|