singlestoredb 1.8.0__cp38-abi3-win32.whl → 1.10.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 +2 -2
- singlestoredb/config.py +6 -0
- singlestoredb/connection.py +11 -0
- singlestoredb/fusion/handler.py +3 -7
- singlestoredb/fusion/handlers/export.py +17 -21
- singlestoredb/fusion/handlers/files.py +690 -0
- singlestoredb/fusion/handlers/stage.py +103 -91
- singlestoredb/fusion/handlers/utils.py +148 -0
- singlestoredb/magics/__init__.py +34 -0
- singlestoredb/magics/run_personal.py +56 -0
- singlestoredb/magics/run_shared.py +53 -0
- singlestoredb/management/__init__.py +1 -0
- singlestoredb/management/cluster.py +2 -1
- singlestoredb/management/export.py +20 -184
- singlestoredb/management/files.py +1039 -0
- singlestoredb/management/manager.py +3 -2
- singlestoredb/management/workspace.py +165 -351
- singlestoredb/mysql/connection.py +9 -1
- singlestoredb/tests/test.ipynb +18 -0
- singlestoredb/tests/test2.ipynb +18 -0
- singlestoredb/tests/test_management.py +273 -1
- {singlestoredb-1.8.0.dist-info → singlestoredb-1.10.0.dist-info}/METADATA +1 -1
- {singlestoredb-1.8.0.dist-info → singlestoredb-1.10.0.dist-info}/RECORD +30 -21
- {singlestoredb-1.8.0.dist-info → singlestoredb-1.10.0.dist-info}/top_level.txt +1 -0
- sqlx/__init__.py +4 -0
- sqlx/magic.py +113 -0
- {singlestoredb-1.8.0.dist-info → singlestoredb-1.10.0.dist-info}/LICENSE +0 -0
- {singlestoredb-1.8.0.dist-info → singlestoredb-1.10.0.dist-info}/WHEEL +0 -0
- {singlestoredb-1.8.0.dist-info → singlestoredb-1.10.0.dist-info}/entry_points.txt +0 -0
_singlestoredb_accel.pyd
CHANGED
|
Binary file
|
singlestoredb/__init__.py
CHANGED
|
@@ -13,7 +13,7 @@ Examples
|
|
|
13
13
|
|
|
14
14
|
"""
|
|
15
15
|
|
|
16
|
-
__version__ = '1.
|
|
16
|
+
__version__ = '1.10.0'
|
|
17
17
|
|
|
18
18
|
from typing import Any
|
|
19
19
|
|
|
@@ -25,7 +25,7 @@ from .exceptions import (
|
|
|
25
25
|
DataError, ManagementError,
|
|
26
26
|
)
|
|
27
27
|
from .management import (
|
|
28
|
-
manage_cluster, manage_workspaces,
|
|
28
|
+
manage_cluster, manage_workspaces, manage_files,
|
|
29
29
|
)
|
|
30
30
|
from .types import (
|
|
31
31
|
Date, Time, Timestamp, DateFromTicks, TimeFromTicks, TimestampFromTicks,
|
singlestoredb/config.py
CHANGED
|
@@ -134,6 +134,12 @@ register_option(
|
|
|
134
134
|
environ='SINGLESTOREDB_SSL_CIPHER',
|
|
135
135
|
)
|
|
136
136
|
|
|
137
|
+
register_option(
|
|
138
|
+
'tls_sni_servername', 'str', check_str, None,
|
|
139
|
+
'Sets TLS SNI servername',
|
|
140
|
+
environ='SINGLESTOREDB_TLS_SNI_SERVERNAME',
|
|
141
|
+
)
|
|
142
|
+
|
|
137
143
|
register_option(
|
|
138
144
|
'ssl_disabled', 'bool', check_bool, False,
|
|
139
145
|
'Disable SSL usage',
|
singlestoredb/connection.py
CHANGED
|
@@ -20,6 +20,7 @@ from typing import Sequence
|
|
|
20
20
|
from typing import Tuple
|
|
21
21
|
from typing import Union
|
|
22
22
|
from urllib.parse import parse_qs
|
|
23
|
+
from urllib.parse import unquote_plus
|
|
23
24
|
from urllib.parse import urlparse
|
|
24
25
|
|
|
25
26
|
import sqlparams
|
|
@@ -284,6 +285,15 @@ def _parse_url(url: str) -> Dict[str, Any]:
|
|
|
284
285
|
if parts.scheme != 'singlestoredb':
|
|
285
286
|
out['driver'] = parts.scheme.lower()
|
|
286
287
|
|
|
288
|
+
if out.get('user'):
|
|
289
|
+
out['user'] = unquote_plus(out['user'])
|
|
290
|
+
|
|
291
|
+
if out.get('password'):
|
|
292
|
+
out['password'] = unquote_plus(out['password'])
|
|
293
|
+
|
|
294
|
+
if out.get('database'):
|
|
295
|
+
out['database'] = unquote_plus(out['database'])
|
|
296
|
+
|
|
287
297
|
# Convert query string to parameters
|
|
288
298
|
out.update({k.lower(): v[-1] for k, v in parse_qs(parts.query).items()})
|
|
289
299
|
|
|
@@ -1288,6 +1298,7 @@ def connect(
|
|
|
1288
1298
|
ssl_key: Optional[str] = None, ssl_cert: Optional[str] = None,
|
|
1289
1299
|
ssl_ca: Optional[str] = None, ssl_disabled: Optional[bool] = None,
|
|
1290
1300
|
ssl_cipher: Optional[str] = None, ssl_verify_cert: Optional[bool] = None,
|
|
1301
|
+
tls_sni_servername: Optional[str] = None,
|
|
1291
1302
|
ssl_verify_identity: Optional[bool] = None,
|
|
1292
1303
|
conv: Optional[Dict[int, Callable[..., Any]]] = None,
|
|
1293
1304
|
credential_type: Optional[str] = None,
|
singlestoredb/fusion/handler.py
CHANGED
|
@@ -74,6 +74,9 @@ BUILTINS = {
|
|
|
74
74
|
'<column>': '',
|
|
75
75
|
'<catalog-name>': '',
|
|
76
76
|
'<link-name>': '',
|
|
77
|
+
'<file-type>': r'''
|
|
78
|
+
file_type = { FILE | FOLDER }
|
|
79
|
+
''',
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
BUILTIN_DEFAULTS = { # type: ignore
|
|
@@ -638,13 +641,6 @@ class SQLHandler(NodeVisitor):
|
|
|
638
641
|
DummySQLResult
|
|
639
642
|
|
|
640
643
|
"""
|
|
641
|
-
import warnings
|
|
642
|
-
warnings.warn(
|
|
643
|
-
'Fusion SQL is currently a preview feature. '
|
|
644
|
-
'Run `SHOW FUSION COMMANDS` to see all commands.',
|
|
645
|
-
RuntimeWarning,
|
|
646
|
-
)
|
|
647
|
-
|
|
648
644
|
type(self).compile()
|
|
649
645
|
self._handled = set()
|
|
650
646
|
try:
|
|
@@ -5,10 +5,8 @@ from typing import Dict
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
from .. import result
|
|
8
|
-
from ...management.export import Catalog
|
|
9
8
|
from ...management.export import ExportService
|
|
10
9
|
from ...management.export import ExportStatus
|
|
11
|
-
from ...management.export import Link
|
|
12
10
|
from ..handler import SQLHandler
|
|
13
11
|
from ..result import FusionSQLResult
|
|
14
12
|
from .utils import get_workspace_group
|
|
@@ -57,10 +55,10 @@ class CreateClusterIdentity(SQLHandler):
|
|
|
57
55
|
|
|
58
56
|
CREATE CLUSTER IDENTITY
|
|
59
57
|
CATALOG CONFIG '{
|
|
60
|
-
"
|
|
58
|
+
"catalog_type": "GLUE",
|
|
61
59
|
"table_format": "ICEBERG",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
60
|
+
"catalog_id": "13983498723498",
|
|
61
|
+
"catalog_region": "us-east-1"
|
|
64
62
|
}'
|
|
65
63
|
LINK S3 CONFIG '{
|
|
66
64
|
"region": "us-east-1",
|
|
@@ -71,8 +69,6 @@ class CreateClusterIdentity(SQLHandler):
|
|
|
71
69
|
|
|
72
70
|
"""
|
|
73
71
|
|
|
74
|
-
_enabled = False
|
|
75
|
-
|
|
76
72
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
77
73
|
# Catalog
|
|
78
74
|
catalog_config = json.loads(params['catalog'].get('catalog_config', '{}') or '{}')
|
|
@@ -82,6 +78,8 @@ class CreateClusterIdentity(SQLHandler):
|
|
|
82
78
|
storage_config = json.loads(params['storage'].get('link_config', '{}') or '{}')
|
|
83
79
|
storage_creds = json.loads(params['storage'].get('link_creds', '{}') or '{}')
|
|
84
80
|
|
|
81
|
+
storage_config['provider'] = 'S3'
|
|
82
|
+
|
|
85
83
|
wsg = get_workspace_group({})
|
|
86
84
|
|
|
87
85
|
if wsg._manager is None:
|
|
@@ -91,14 +89,14 @@ class CreateClusterIdentity(SQLHandler):
|
|
|
91
89
|
wsg,
|
|
92
90
|
'none',
|
|
93
91
|
'none',
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
dict(**catalog_config, **catalog_creds),
|
|
93
|
+
dict(**storage_config, **storage_creds),
|
|
96
94
|
columns=None,
|
|
97
95
|
).create_cluster_identity()
|
|
98
96
|
|
|
99
97
|
res = FusionSQLResult()
|
|
100
|
-
res.add_field('
|
|
101
|
-
res.set_rows([(out['
|
|
98
|
+
res.add_field('Identity', result.STRING)
|
|
99
|
+
res.set_rows([(out['identity'],)])
|
|
102
100
|
|
|
103
101
|
return res
|
|
104
102
|
|
|
@@ -149,12 +147,12 @@ class CreateExport(SQLHandler):
|
|
|
149
147
|
catalog and link configurations. The source table to export is
|
|
150
148
|
named "customer_data"::
|
|
151
149
|
|
|
152
|
-
START EXPORT FROM customer_data
|
|
150
|
+
START EXPORT FROM my_db.customer_data
|
|
153
151
|
CATALOG CONFIG '{
|
|
154
|
-
"
|
|
152
|
+
"catalog_type": "GLUE",
|
|
155
153
|
"table_format": "ICEBERG",
|
|
156
|
-
"
|
|
157
|
-
"
|
|
154
|
+
"catalog_id": "13983498723498",
|
|
155
|
+
"catalog_region": "us-east-1"
|
|
158
156
|
}'
|
|
159
157
|
LINK S3 CONFIG '{
|
|
160
158
|
"region": "us-east-1",
|
|
@@ -165,8 +163,6 @@ class CreateExport(SQLHandler):
|
|
|
165
163
|
|
|
166
164
|
""" # noqa
|
|
167
165
|
|
|
168
|
-
_enabled = False
|
|
169
|
-
|
|
170
166
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
171
167
|
# From table
|
|
172
168
|
if isinstance(params['from_table'], str):
|
|
@@ -183,6 +179,8 @@ class CreateExport(SQLHandler):
|
|
|
183
179
|
storage_config = json.loads(params['storage'].get('link_config', '{}') or '{}')
|
|
184
180
|
storage_creds = json.loads(params['storage'].get('link_creds', '{}') or '{}')
|
|
185
181
|
|
|
182
|
+
storage_config['provider'] = 'S3'
|
|
183
|
+
|
|
186
184
|
wsg = get_workspace_group({})
|
|
187
185
|
|
|
188
186
|
if from_database is None:
|
|
@@ -195,8 +193,8 @@ class CreateExport(SQLHandler):
|
|
|
195
193
|
wsg,
|
|
196
194
|
from_database,
|
|
197
195
|
from_table,
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
dict(**catalog_config, **catalog_creds),
|
|
197
|
+
dict(**storage_config, **storage_creds),
|
|
200
198
|
columns=None,
|
|
201
199
|
).start()
|
|
202
200
|
|
|
@@ -219,8 +217,6 @@ class ShowExport(SQLHandler):
|
|
|
219
217
|
|
|
220
218
|
"""
|
|
221
219
|
|
|
222
|
-
_enabled = False
|
|
223
|
-
|
|
224
220
|
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
|
|
225
221
|
wsg = get_workspace_group({})
|
|
226
222
|
out = ExportStatus(params['export_id'], wsg)
|