singlestoredb 1.8.0__py3-none-any.whl → 1.9.0__py3-none-any.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/__init__.py CHANGED
@@ -13,7 +13,7 @@ Examples
13
13
 
14
14
  """
15
15
 
16
- __version__ = '1.8.0'
16
+ __version__ = '1.9.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',
@@ -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,
@@ -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
@@ -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
@@ -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 '{}')
@@ -91,14 +87,14 @@ class CreateClusterIdentity(SQLHandler):
91
87
  wsg,
92
88
  'none',
93
89
  'none',
94
- Catalog.from_config_and_creds(catalog_config, catalog_creds, wsg._manager),
95
- Link.from_config_and_creds('S3', storage_config, storage_creds, wsg._manager),
90
+ dict(**catalog_config, **catalog_creds),
91
+ dict(**storage_config, **storage_creds),
96
92
  columns=None,
97
93
  ).create_cluster_identity()
98
94
 
99
95
  res = FusionSQLResult()
100
- res.add_field('RoleARN', result.STRING)
101
- res.set_rows([(out['roleARN'],)])
96
+ res.add_field('Identity', result.STRING)
97
+ res.set_rows([(out['identity'],)])
102
98
 
103
99
  return res
104
100
 
@@ -165,8 +161,6 @@ class CreateExport(SQLHandler):
165
161
 
166
162
  """ # noqa
167
163
 
168
- _enabled = False
169
-
170
164
  def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
171
165
  # From table
172
166
  if isinstance(params['from_table'], str):
@@ -195,8 +189,8 @@ class CreateExport(SQLHandler):
195
189
  wsg,
196
190
  from_database,
197
191
  from_table,
198
- Catalog.from_config_and_creds(catalog_config, catalog_creds, wsg._manager),
199
- Link.from_config_and_creds('S3', storage_config, storage_creds, wsg._manager),
192
+ dict(**catalog_config, **catalog_creds),
193
+ dict(**storage_config, **storage_creds),
200
194
  columns=None,
201
195
  ).start()
202
196
 
@@ -219,8 +213,6 @@ class ShowExport(SQLHandler):
219
213
 
220
214
  """
221
215
 
222
- _enabled = False
223
-
224
216
  def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
225
217
  wsg = get_workspace_group({})
226
218
  out = ExportStatus(params['export_id'], wsg)