scylla-cqlsh 6.0.21__cp310-cp310-macosx_10_9_x86_64.whl → 6.0.24__cp310-cp310-macosx_10_9_x86_64.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 scylla-cqlsh might be problematic. Click here for more details.
- copyutil.cpython-310-darwin.so +0 -0
- cqlsh/cqlsh.py +67 -41
- cqlshlib/_version.py +2 -2
- {scylla_cqlsh-6.0.21.dist-info → scylla_cqlsh-6.0.24.dist-info}/METADATA +16 -3
- {scylla_cqlsh-6.0.21.dist-info → scylla_cqlsh-6.0.24.dist-info}/RECORD +9 -9
- {scylla_cqlsh-6.0.21.dist-info → scylla_cqlsh-6.0.24.dist-info}/WHEEL +1 -1
- {scylla_cqlsh-6.0.21.dist-info → scylla_cqlsh-6.0.24.dist-info}/LICENSE.txt +0 -0
- {scylla_cqlsh-6.0.21.dist-info → scylla_cqlsh-6.0.24.dist-info}/entry_points.txt +0 -0
- {scylla_cqlsh-6.0.21.dist-info → scylla_cqlsh-6.0.24.dist-info}/top_level.txt +0 -0
copyutil.cpython-310-darwin.so
CHANGED
|
Binary file
|
cqlsh/cqlsh.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/python3
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
4
4
|
# or more contributor license agreements. See the NOTICE file
|
|
@@ -32,6 +32,7 @@ import sys
|
|
|
32
32
|
import traceback
|
|
33
33
|
import warnings
|
|
34
34
|
import webbrowser
|
|
35
|
+
import logging
|
|
35
36
|
from contextlib import contextmanager
|
|
36
37
|
from glob import glob
|
|
37
38
|
from io import StringIO
|
|
@@ -201,6 +202,8 @@ parser.add_option('-k', '--keyspace', help='Authenticate to the given keyspace.'
|
|
|
201
202
|
parser.add_option("-f", "--file", help="Execute commands from FILE, then exit")
|
|
202
203
|
parser.add_option('--debug', action='store_true',
|
|
203
204
|
help='Show additional debugging information')
|
|
205
|
+
parser.add_option('--driver-debug', action='store_true',
|
|
206
|
+
help='Show additional driver debugging information')
|
|
204
207
|
parser.add_option('--coverage', action='store_true',
|
|
205
208
|
help='Collect coverage data')
|
|
206
209
|
parser.add_option("--encoding", help="Specify a non-default encoding for output."
|
|
@@ -488,7 +491,7 @@ class Shell(cmd.Cmd):
|
|
|
488
491
|
if os.path.exists(self.hostname) and stat.S_ISSOCK(os.stat(self.hostname).st_mode):
|
|
489
492
|
kwargs['contact_points'] = (UnixSocketEndPoint(self.hostname),)
|
|
490
493
|
self.profiles[EXEC_PROFILE_DEFAULT].load_balancing_policy = WhiteListRoundRobinPolicy([UnixSocketEndPoint(self.hostname)])
|
|
491
|
-
else:
|
|
494
|
+
else:
|
|
492
495
|
kwargs['contact_points'] = (self.hostname,)
|
|
493
496
|
self.profiles[EXEC_PROFILE_DEFAULT].load_balancing_policy = WhiteListRoundRobinPolicy([self.hostname])
|
|
494
497
|
kwargs['port'] = self.port
|
|
@@ -1008,6 +1011,21 @@ class Shell(cmd.Cmd):
|
|
|
1008
1011
|
cmdword = tokens[0][1]
|
|
1009
1012
|
if cmdword == '?':
|
|
1010
1013
|
cmdword = 'help'
|
|
1014
|
+
|
|
1015
|
+
cmdword_lower = cmdword.lower()
|
|
1016
|
+
|
|
1017
|
+
# Describe statements get special treatment: we first want to
|
|
1018
|
+
# send the request to the server and only when it fails will
|
|
1019
|
+
# we attempt to perform it locally. That's why we don't want
|
|
1020
|
+
# to follow the logic below that starts with parsing.
|
|
1021
|
+
#
|
|
1022
|
+
# The reason for that is changes in Scylla may need to be reflected
|
|
1023
|
+
# in the grammar used in cqlsh. We want Scylla to be "independent"
|
|
1024
|
+
# in that regard, so unless necessary, we don't want to do the parsing
|
|
1025
|
+
# here.
|
|
1026
|
+
if cmdword_lower == 'describe' or cmdword_lower == 'desc':
|
|
1027
|
+
return self.perform_describe(cmdword, tokens, srcstr)
|
|
1028
|
+
|
|
1011
1029
|
custom_handler = getattr(self, 'do_' + cmdword.lower(), None)
|
|
1012
1030
|
if custom_handler:
|
|
1013
1031
|
parsed = cqlruleset.cql_whole_parse_tokens(tokens, srcstr=srcstr,
|
|
@@ -1497,8 +1515,8 @@ class Shell(cmd.Cmd):
|
|
|
1497
1515
|
self.print_recreate_keyspace(k, sys.stdout)
|
|
1498
1516
|
print('')
|
|
1499
1517
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1518
|
+
# Precondition: the first token in `srcstr.lower()` is either `describe` or `desc`.
|
|
1519
|
+
def perform_describe(self, cmdword, tokens, srcstr):
|
|
1502
1520
|
"""
|
|
1503
1521
|
DESCRIBE [cqlsh only]
|
|
1504
1522
|
|
|
@@ -1589,10 +1607,8 @@ class Shell(cmd.Cmd):
|
|
|
1589
1607
|
where object can be either a keyspace or a table or an index or a materialized
|
|
1590
1608
|
view (in this order).
|
|
1591
1609
|
"""
|
|
1592
|
-
self._do_describe(parsed, force_client_side_describe=False)
|
|
1593
1610
|
|
|
1594
|
-
|
|
1595
|
-
if force_client_side_describe:
|
|
1611
|
+
def perform_describe_locally(parsed):
|
|
1596
1612
|
what = parsed.matched[1][1].lower()
|
|
1597
1613
|
if what == 'functions':
|
|
1598
1614
|
self.describe_functions_client(self.current_keyspace)
|
|
@@ -1650,40 +1666,45 @@ class Shell(cmd.Cmd):
|
|
|
1650
1666
|
if not name:
|
|
1651
1667
|
name = self.cql_unprotect_name(parsed.get_binding('mvname', None))
|
|
1652
1668
|
self.describe_object_client(ks, name)
|
|
1653
|
-
else:
|
|
1654
|
-
stmt = SimpleStatement(parsed.extract_orig(), consistency_level=cassandra.ConsistencyLevel.LOCAL_ONE,
|
|
1655
|
-
fetch_size=self.page_size if self.use_paging else None)
|
|
1656
|
-
future = self.session.execute_async(stmt)
|
|
1657
|
-
try:
|
|
1658
|
-
result = future.result()
|
|
1659
|
-
|
|
1660
|
-
what = parsed.matched[1][1].lower()
|
|
1661
|
-
|
|
1662
|
-
if what in ('columnfamilies', 'tables', 'types', 'functions', 'aggregates'):
|
|
1663
|
-
self.describe_list(result)
|
|
1664
|
-
elif what == 'keyspaces':
|
|
1665
|
-
self.describe_keyspaces(result)
|
|
1666
|
-
elif what == 'cluster':
|
|
1667
|
-
self.describe_cluster(result)
|
|
1668
|
-
elif what:
|
|
1669
|
-
self.describe_element(result)
|
|
1670
|
-
|
|
1671
|
-
except cassandra.protocol.SyntaxException:
|
|
1672
|
-
# Server doesn't support DESCRIBE query, retry with
|
|
1673
|
-
# client-side DESCRIBE implementation
|
|
1674
|
-
self._do_describe(parsed, force_client_side_describe=True)
|
|
1675
|
-
except CQL_ERRORS as err:
|
|
1676
|
-
err_msg = err.message if hasattr(err, 'message') else str(err)
|
|
1677
|
-
self.printerr(err_msg.partition("message=")[2].strip('"'))
|
|
1678
|
-
except Exception:
|
|
1679
|
-
import traceback
|
|
1680
|
-
self.printerr(traceback.format_exc())
|
|
1681
1669
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1670
|
+
stmt = SimpleStatement(srcstr, consistency_level=cassandra.ConsistencyLevel.LOCAL_ONE,
|
|
1671
|
+
fetch_size=self.page_size if self.use_paging else None)
|
|
1672
|
+
future = self.session.execute_async(stmt)
|
|
1673
|
+
try:
|
|
1674
|
+
result = future.result()
|
|
1675
|
+
|
|
1676
|
+
# The second token in the statement indicates which
|
|
1677
|
+
# kind of DESCRIBE we're performing.
|
|
1678
|
+
what = srcstr.split()[1].lower().rstrip(';')
|
|
1679
|
+
|
|
1680
|
+
if what in ('columnfamilies', 'tables', 'types', 'functions', 'aggregates'):
|
|
1681
|
+
self.describe_list(result)
|
|
1682
|
+
elif what == 'keyspaces':
|
|
1683
|
+
self.describe_keyspaces(result)
|
|
1684
|
+
elif what == 'cluster':
|
|
1685
|
+
self.describe_cluster(result)
|
|
1686
|
+
elif what:
|
|
1687
|
+
self.describe_element(result)
|
|
1688
|
+
|
|
1689
|
+
except cassandra.protocol.SyntaxException:
|
|
1690
|
+
# Server doesn't support DESCRIBE query, retry with
|
|
1691
|
+
# client-side DESCRIBE implementation
|
|
1692
|
+
parsed = cqlruleset.cql_whole_parse_tokens(tokens, srcstr=srcstr,
|
|
1693
|
+
startsymbol='cqlshCommand')
|
|
1694
|
+
if parsed and not parsed.remainder:
|
|
1695
|
+
return perform_describe_locally(parsed)
|
|
1696
|
+
else:
|
|
1697
|
+
return self.handle_parse_error(cmdword, tokens, parsed, srcstr)
|
|
1698
|
+
except CQL_ERRORS as err:
|
|
1699
|
+
err_msg = err.message if hasattr(err, 'message') else str(err)
|
|
1700
|
+
self.printerr(err_msg.partition("message=")[2].strip('"'))
|
|
1701
|
+
except Exception:
|
|
1702
|
+
import traceback
|
|
1703
|
+
self.printerr(traceback.format_exc())
|
|
1685
1704
|
|
|
1686
|
-
|
|
1705
|
+
if future:
|
|
1706
|
+
if future.warnings:
|
|
1707
|
+
self.print_warnings(future.warnings)
|
|
1687
1708
|
|
|
1688
1709
|
def describe_keyspaces(self, rows):
|
|
1689
1710
|
"""
|
|
@@ -2454,7 +2475,7 @@ def read_options(cmdlineargs, environment):
|
|
|
2454
2475
|
optvalues.timezone = option_with_default(configs.get, 'ui', 'timezone', None)
|
|
2455
2476
|
|
|
2456
2477
|
optvalues.debug = False
|
|
2457
|
-
|
|
2478
|
+
optvalues.driver_debug = False
|
|
2458
2479
|
optvalues.coverage = False
|
|
2459
2480
|
if 'CQLSH_COVERAGE' in environment.keys():
|
|
2460
2481
|
optvalues.coverage = True
|
|
@@ -2520,7 +2541,7 @@ def read_options(cmdlineargs, environment):
|
|
|
2520
2541
|
parser.error("Cannot use --cloudconf with hostname or port")
|
|
2521
2542
|
if options.ssl:
|
|
2522
2543
|
parser.error("Cannot use --cloudconf with --ssl. Cloud connection encryption parameters are provided by cloud config bundle.")
|
|
2523
|
-
|
|
2544
|
+
|
|
2524
2545
|
|
|
2525
2546
|
hostname = option_with_default(configs.get, 'connection', 'hostname', DEFAULT_HOST)
|
|
2526
2547
|
port = option_with_default(configs.get, 'connection', 'port', DEFAULT_PORT)
|
|
@@ -2607,6 +2628,11 @@ def save_history():
|
|
|
2607
2628
|
|
|
2608
2629
|
|
|
2609
2630
|
def main(options, hostname, port):
|
|
2631
|
+
if options.driver_debug:
|
|
2632
|
+
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
2633
|
+
stream=sys.stdout)
|
|
2634
|
+
logging.getLogger("cassandra").setLevel(logging.DEBUG)
|
|
2635
|
+
|
|
2610
2636
|
setup_cqlruleset(options.cqlmodule)
|
|
2611
2637
|
setup_cqldocs(options.cqlmodule)
|
|
2612
2638
|
init_history()
|
cqlshlib/_version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: scylla-cqlsh
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.24
|
|
4
4
|
Summary: cqlsh is a Python-based command-line client for running CQL commands on a scylla cluster.
|
|
5
5
|
Home-page: https://github.com/scylladb/scylla-cqlsh
|
|
6
6
|
Author: Israel Fruchter
|
|
@@ -17,7 +17,10 @@ Classifier: Programming Language :: Python :: 3
|
|
|
17
17
|
Requires-Python: >=3.6
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE.txt
|
|
20
|
-
Requires-Dist: scylla-driver
|
|
20
|
+
Requires-Dist: scylla-driver>=3.25.10
|
|
21
|
+
Dynamic: classifier
|
|
22
|
+
Dynamic: license
|
|
23
|
+
Dynamic: requires-dist
|
|
21
24
|
|
|
22
25
|
# scylla-cqlsh
|
|
23
26
|
|
|
@@ -81,6 +84,16 @@ ccm start
|
|
|
81
84
|
pytest
|
|
82
85
|
```
|
|
83
86
|
|
|
87
|
+
## Build from source
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pip install build
|
|
91
|
+
# optionally can disable the usage of cython
|
|
92
|
+
# export CQLSH_NO_CYTHON=true
|
|
93
|
+
python -m build -w
|
|
94
|
+
...
|
|
95
|
+
Successfully built scylla_cqlsh-6.0.24.dev0+gb09bc79361.d20240910-py3-none-any.whl
|
|
96
|
+
```
|
|
84
97
|
|
|
85
98
|
## Creation of the repo
|
|
86
99
|
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
copyutil.cpython-310-darwin.so,sha256=
|
|
2
|
-
scylla_cqlsh-6.0.21.dist-info/RECORD,,
|
|
3
|
-
scylla_cqlsh-6.0.21.dist-info/WHEEL,sha256=XuCvCdU3jPoWc8zSQt2yCbU0ma4nfvvSGuaFUTARw9I,110
|
|
4
|
-
scylla_cqlsh-6.0.21.dist-info/entry_points.txt,sha256=oE4unqgR3WwNkCJDGlMG1HYtCE3nEZZ4d9CIl-JSZyQ,46
|
|
5
|
-
scylla_cqlsh-6.0.21.dist-info/top_level.txt,sha256=PVG-5w7PDG3FoAJH6Rq2I8C0y4cKa2KOW75GxjHkmQ4,24
|
|
6
|
-
scylla_cqlsh-6.0.21.dist-info/LICENSE.txt,sha256=JAuKOf39K9OzU5wC40RmM0iE_ISwVrV_BunaNTI-zZc,11360
|
|
7
|
-
scylla_cqlsh-6.0.21.dist-info/METADATA,sha256=Nt65voJuRc4UHZ37DxsbH2z-jI8u7oF5Zbjkxb6jiR4,2814
|
|
1
|
+
copyutil.cpython-310-darwin.so,sha256=8tMXwSZtXWyzBoFWPiJsUVnWGFg81bRUvbX4HGskvOY,1428536
|
|
8
2
|
cqlshlib/authproviderhandling.py,sha256=p4r_sk64AC5eiv__n-gjwQk2Ni_CcK6lyAWSKEcgINs,7078
|
|
9
3
|
cqlshlib/cqlshhandling.py,sha256=BUu9wi7H1Xgil9lci-48TCPQ1xwe2-OTNXsW7jiewlM,10510
|
|
10
4
|
cqlshlib/tracing.py,sha256=ct7siXwNMINjGVXn9qr5h7XhDDM6Bi1uLljPUtcve-A,3403
|
|
11
5
|
cqlshlib/sslhandling.py,sha256=TtEib4N-BuL2KZJiGYijc9DQviYp2lzYlwLj4RLp0oQ,4649
|
|
12
6
|
cqlshlib/saferscanner.py,sha256=T4eSYVWuZf4piTS9PgHjFhuY6g1fOb4VVa1Bu4Y1v_I,3539
|
|
13
|
-
cqlshlib/_version.py,sha256=
|
|
7
|
+
cqlshlib/_version.py,sha256=TIlYRiIbI1CP5zmef0gFLtPKwkTlJEhN9pTlUGRF-uI,413
|
|
14
8
|
cqlshlib/wcwidth.py,sha256=PsbF7OaDlLItaiV6niu8F_OOgVYLJo0Ypb5-cOJV3QY,15865
|
|
15
9
|
cqlshlib/displaying.py,sha256=bsA7T4BwQHgtH4jzCJeU3JrpgMT5k0xZ7EA2AnhYG7g,3977
|
|
16
10
|
cqlshlib/util.py,sha256=qWQmq9v28vZwZ4apzK0-UQOYPIW3TMk-Jq9I69LbW0k,5057
|
|
@@ -21,6 +15,12 @@ cqlshlib/copyutil.py,sha256=mORX85C5CFqNSIoElATn4vKjUaCdUL8td5blyXlFDHI,113415
|
|
|
21
15
|
cqlshlib/helptopics.py,sha256=bBPtNHn2ySgO9K4nFBpJw2gcibryIdRh7dm3b9TUubQ,4524
|
|
22
16
|
cqlshlib/pylexotron.py,sha256=QY3nZ-fP-yGFIixMV33IgMlKV8A51AxnNYya0PGZc6I,19273
|
|
23
17
|
cqlshlib/cql3handling.py,sha256=cAE_UW8sg4UJ8PjS5rbbZn-O3_L9m2297Or-8f2s72Y,59123
|
|
24
|
-
cqlsh/cqlsh.py,sha256=
|
|
18
|
+
cqlsh/cqlsh.py,sha256=sWvoOFumWrjpO5TYggat54o-sJjBOZjgAg6rwB_7s0U,113232
|
|
25
19
|
cqlsh/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
26
20
|
cqlsh/__main__.py,sha256=-IR7kYVwXf9uq9OBeVlAB5I386E1N9iEhrjn3sCw-74,220
|
|
21
|
+
scylla_cqlsh-6.0.24.dist-info/RECORD,,
|
|
22
|
+
scylla_cqlsh-6.0.24.dist-info/WHEEL,sha256=7ffzAg6B9jNsI5fzXAu6JnblIkGEPEYZBaLviKorHoo,110
|
|
23
|
+
scylla_cqlsh-6.0.24.dist-info/entry_points.txt,sha256=oE4unqgR3WwNkCJDGlMG1HYtCE3nEZZ4d9CIl-JSZyQ,46
|
|
24
|
+
scylla_cqlsh-6.0.24.dist-info/top_level.txt,sha256=PVG-5w7PDG3FoAJH6Rq2I8C0y4cKa2KOW75GxjHkmQ4,24
|
|
25
|
+
scylla_cqlsh-6.0.24.dist-info/LICENSE.txt,sha256=JAuKOf39K9OzU5wC40RmM0iE_ISwVrV_BunaNTI-zZc,11360
|
|
26
|
+
scylla_cqlsh-6.0.24.dist-info/METADATA,sha256=lyOjkrebTK_b_y0QXfDyFbFHPodtMnt2jGkHIJZCrNc,3106
|
|
File without changes
|
|
File without changes
|
|
File without changes
|