singlestoredb 1.5.0__cp38-abi3-win32.whl → 1.6.1__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/fusion/handler.py +17 -9
- singlestoredb/fusion/handlers/job.py +658 -0
- singlestoredb/fusion/handlers/workspace.py +33 -10
- singlestoredb/management/job.py +887 -0
- singlestoredb/management/organization.py +17 -0
- singlestoredb/management/utils.py +47 -1
- singlestoredb/mysql/connection.py +7 -6
- singlestoredb/tests/test_fusion.py +250 -1
- singlestoredb/tests/test_management.py +152 -0
- singlestoredb/tests/utils.py +7 -0
- {singlestoredb-1.5.0.dist-info → singlestoredb-1.6.1.dist-info}/METADATA +1 -1
- {singlestoredb-1.5.0.dist-info → singlestoredb-1.6.1.dist-info}/RECORD +18 -16
- {singlestoredb-1.5.0.dist-info → singlestoredb-1.6.1.dist-info}/LICENSE +0 -0
- {singlestoredb-1.5.0.dist-info → singlestoredb-1.6.1.dist-info}/WHEEL +0 -0
- {singlestoredb-1.5.0.dist-info → singlestoredb-1.6.1.dist-info}/entry_points.txt +0 -0
- {singlestoredb-1.5.0.dist-info → singlestoredb-1.6.1.dist-info}/top_level.txt +0 -0
_singlestoredb_accel.pyd
CHANGED
|
Binary file
|
singlestoredb/__init__.py
CHANGED
singlestoredb/fusion/handler.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import abc
|
|
3
3
|
import functools
|
|
4
4
|
import re
|
|
5
|
+
import sys
|
|
5
6
|
import textwrap
|
|
6
7
|
from typing import Any
|
|
7
8
|
from typing import Callable
|
|
@@ -102,7 +103,7 @@ def json_unescape(s: str) -> str:
|
|
|
102
103
|
|
|
103
104
|
def get_keywords(grammar: str) -> Tuple[str, ...]:
|
|
104
105
|
"""Return all all-caps words from the beginning of the line."""
|
|
105
|
-
m = re.match(r'^\s*((?:[A-Z0-9_]+)(\s+|$|;))+', grammar)
|
|
106
|
+
m = re.match(r'^\s*((?:[@A-Z0-9_]+)(\s+|$|;))+', grammar)
|
|
106
107
|
if not m:
|
|
107
108
|
return tuple()
|
|
108
109
|
return tuple(re.split(r'\s+', m.group(0).replace(';', '').strip()))
|
|
@@ -110,7 +111,7 @@ def get_keywords(grammar: str) -> Tuple[str, ...]:
|
|
|
110
111
|
|
|
111
112
|
def is_bool(grammar: str) -> bool:
|
|
112
113
|
"""Determine if the rule is a boolean."""
|
|
113
|
-
return bool(re.match(r'^[A-Z0-9_\s*]+$', grammar))
|
|
114
|
+
return bool(re.match(r'^[@A-Z0-9_\s*]+$', grammar))
|
|
114
115
|
|
|
115
116
|
|
|
116
117
|
def process_optional(m: Any) -> str:
|
|
@@ -137,8 +138,9 @@ def process_repeats(m: Any) -> str:
|
|
|
137
138
|
|
|
138
139
|
def lower_and_regex(m: Any) -> str:
|
|
139
140
|
"""Lowercase and convert literal to regex."""
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
start = m.group(1) or ''
|
|
142
|
+
sql = m.group(2)
|
|
143
|
+
return f'~"{start}{sql.lower()}"i'
|
|
142
144
|
|
|
143
145
|
|
|
144
146
|
def split_unions(grammar: str) -> str:
|
|
@@ -415,7 +417,7 @@ def process_grammar(
|
|
|
415
417
|
sql = re.sub(r'\]\s+\[', r' | ', sql)
|
|
416
418
|
|
|
417
419
|
# Lower-case keywords and make them case-insensitive
|
|
418
|
-
sql = re.sub(r'\b([A-Z0-9]+)\b', lower_and_regex, sql)
|
|
420
|
+
sql = re.sub(r'(\b|@+)([A-Z0-9]+)\b', lower_and_regex, sql)
|
|
419
421
|
|
|
420
422
|
# Convert literal strings to 'qs'
|
|
421
423
|
sql = re.sub(r"'[^']+'", r'qs', sql)
|
|
@@ -479,10 +481,16 @@ def process_grammar(
|
|
|
479
481
|
cmds = ' / '.join(x for x in rules if x.endswith('_cmd'))
|
|
480
482
|
cmds = f'init = ws* ( {cmds} ) ws* ";"? ws*\n'
|
|
481
483
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
grammar = cmds + CORE_GRAMMAR + '\n'.join(out)
|
|
485
|
+
|
|
486
|
+
try:
|
|
487
|
+
return (
|
|
488
|
+
Grammar(grammar), command_key,
|
|
489
|
+
rule_info, syntax_txt, help_txt,
|
|
490
|
+
)
|
|
491
|
+
except ParseError:
|
|
492
|
+
print(grammar, file=sys.stderr)
|
|
493
|
+
raise
|
|
486
494
|
|
|
487
495
|
|
|
488
496
|
def flatten(items: Iterable[Any]) -> List[Any]:
|