scylla-cqlsh 6.0.21__tar.gz → 6.0.23__tar.gz
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.
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/.github/workflows/build-push.yml +8 -5
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/.gitignore +3 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/PKG-INFO +11 -1
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/README.md +10 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/SCYLLA-VERSION-GEN +1 -1
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/bin/cqlsh.py +58 -40
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlsh/cqlsh.py +58 -40
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/_version.py +2 -2
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/copyutil.c +2070 -1963
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/control.template +2 -2
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/redhat/scylla-cqlsh.spec +4 -3
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/install.sh +1 -3
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/run_cqlsh.py +3 -2
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_cqlsh_output.py +2 -2
- scylla_cqlsh-6.0.23/pylib/cqlshlib/test/test_formatting.py +69 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/setup.py +3 -5
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/reloc/build_reloc.sh +3 -16
- scylla_cqlsh-6.0.23/requirements.txt +3 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scripts/create-relocatable-package.py +32 -4
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scylla_cqlsh.egg-info/PKG-INFO +11 -1
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scylla_cqlsh.egg-info/SOURCES.txt +1 -1
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/setup.py +3 -5
- scylla_cqlsh-6.0.21/bin/cqlsh +0 -99
- scylla_cqlsh-6.0.21/requirements.txt +0 -5
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/.dockerignore +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/.github/workflows/dockerhub-description.yml +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/Dockerfile +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/LICENSE.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlsh/__init__.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlsh/__main__.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/__init__.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/authproviderhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/copyutil.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/cql3handling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/cqlhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/cqlshhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/displaying.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/formatting.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/helptopics.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/pylexotron.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/saferscanner.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/sslhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/tracing.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/util.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/cqlshlib/wcwidth.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/changelog.template +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/debian/compat +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/debian/copyright +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/debian/rules +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/debian/source/format +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/debian/source/options +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/dist/debian/debian_files_gen.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/install-dependencies.sh +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/Dockerfile.ubuntu.py3 +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/Dockerfile.ubuntu.py37 +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/Dockerfile.ubuntu.py38 +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/README.asc +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cassandra-cqlsh-tests.sh +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/__init__.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/authproviderhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/copyutil.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/cql3handling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/cqlhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/cqlshhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/displaying.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/formatting.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/helptopics.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/pylexotron.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/saferscanner.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/sslhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/__init__.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/ansi_colors.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/basecase.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/cassconnect.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/reserved_keywords.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/complex_auth_provider +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/complex_auth_provider_creds +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/complex_auth_provider_with_pass +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/empty_example +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/full_plain_text_example +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/illegal_example +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/no_classname_example +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/partial_example +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/plain_text_full_creds +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/plain_text_legacy +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/plain_text_partial_creds +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_authproviderhandling_config/plain_text_partial_example +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_constants.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_copyutil.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_cql_parsing.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_cqlsh_completion.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_keyspace_init.cql +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_legacy_auth.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/test_unicode.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/test/winpty.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/tracing.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/util.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/cqlshlib/wcwidth.py +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pylib/requirements.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/pyproject.toml +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/reloc/build_deb.sh +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/reloc/build_rpm.sh +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scylla_cqlsh.egg-info/dependency_links.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scylla_cqlsh.egg-info/entry_points.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scylla_cqlsh.egg-info/requires.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/scylla_cqlsh.egg-info/top_level.txt +0 -0
- {scylla_cqlsh-6.0.21 → scylla_cqlsh-6.0.23}/setup.cfg +0 -0
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
runs-on: ${{ matrix.os }}
|
|
21
21
|
strategy:
|
|
22
22
|
matrix:
|
|
23
|
-
os: [ubuntu-20.04, windows-2019, macos-
|
|
23
|
+
os: [ubuntu-20.04, windows-2019, macos-13, macos-14]
|
|
24
24
|
|
|
25
25
|
steps:
|
|
26
26
|
- uses: actions/checkout@v3
|
|
@@ -28,8 +28,9 @@ jobs:
|
|
|
28
28
|
- name: Build wheels
|
|
29
29
|
uses: pypa/cibuildwheel@v2.16.5
|
|
30
30
|
|
|
31
|
-
- uses: actions/upload-artifact@
|
|
31
|
+
- uses: actions/upload-artifact@v4
|
|
32
32
|
with:
|
|
33
|
+
name: wheels-${{ matrix.os }}
|
|
33
34
|
path: ./wheelhouse/*.whl
|
|
34
35
|
|
|
35
36
|
build_sdist:
|
|
@@ -43,8 +44,9 @@ jobs:
|
|
|
43
44
|
run: |
|
|
44
45
|
pipx run build --sdist
|
|
45
46
|
|
|
46
|
-
- uses: actions/upload-artifact@
|
|
47
|
+
- uses: actions/upload-artifact@v4
|
|
47
48
|
with:
|
|
49
|
+
name: source-dist
|
|
48
50
|
path: dist/*.tar.gz
|
|
49
51
|
|
|
50
52
|
integration_test_scylla:
|
|
@@ -198,12 +200,13 @@ jobs:
|
|
|
198
200
|
# alternatively, to publish when a GitHub Release is created, use the following rule:
|
|
199
201
|
# if: github.event_name == 'release' && github.event.action == 'published'
|
|
200
202
|
steps:
|
|
201
|
-
- uses: actions/download-artifact@
|
|
203
|
+
- uses: actions/download-artifact@v4
|
|
202
204
|
with:
|
|
203
|
-
name: artifact
|
|
204
205
|
path: dist
|
|
206
|
+
merge-multiple: true
|
|
205
207
|
|
|
206
208
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
207
209
|
with:
|
|
210
|
+
skip-existing: true
|
|
208
211
|
user: __token__
|
|
209
212
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: scylla-cqlsh
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.23
|
|
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
|
|
@@ -81,6 +81,16 @@ ccm start
|
|
|
81
81
|
pytest
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
## Build from source
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install build
|
|
88
|
+
# optionally can disable the usage of cython
|
|
89
|
+
# export CQLSH_NO_CYTHON=true
|
|
90
|
+
python -m build -w
|
|
91
|
+
...
|
|
92
|
+
Successfully built scylla_cqlsh-6.0.24.dev0+gb09bc79361.d20240910-py3-none-any.whl
|
|
93
|
+
```
|
|
84
94
|
|
|
85
95
|
## Creation of the repo
|
|
86
96
|
|
|
@@ -60,6 +60,16 @@ ccm start
|
|
|
60
60
|
pytest
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
## Build from source
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
pip install build
|
|
67
|
+
# optionally can disable the usage of cython
|
|
68
|
+
# export CQLSH_NO_CYTHON=true
|
|
69
|
+
python -m build -w
|
|
70
|
+
...
|
|
71
|
+
Successfully built scylla_cqlsh-6.0.24.dev0+gb09bc79361.d20240910-py3-none-any.whl
|
|
72
|
+
```
|
|
63
73
|
|
|
64
74
|
## Creation of the repo
|
|
65
75
|
|
|
@@ -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
|
|
@@ -488,7 +488,7 @@ class Shell(cmd.Cmd):
|
|
|
488
488
|
if os.path.exists(self.hostname) and stat.S_ISSOCK(os.stat(self.hostname).st_mode):
|
|
489
489
|
kwargs['contact_points'] = (UnixSocketEndPoint(self.hostname),)
|
|
490
490
|
self.profiles[EXEC_PROFILE_DEFAULT].load_balancing_policy = WhiteListRoundRobinPolicy([UnixSocketEndPoint(self.hostname)])
|
|
491
|
-
else:
|
|
491
|
+
else:
|
|
492
492
|
kwargs['contact_points'] = (self.hostname,)
|
|
493
493
|
self.profiles[EXEC_PROFILE_DEFAULT].load_balancing_policy = WhiteListRoundRobinPolicy([self.hostname])
|
|
494
494
|
kwargs['port'] = self.port
|
|
@@ -1008,6 +1008,21 @@ class Shell(cmd.Cmd):
|
|
|
1008
1008
|
cmdword = tokens[0][1]
|
|
1009
1009
|
if cmdword == '?':
|
|
1010
1010
|
cmdword = 'help'
|
|
1011
|
+
|
|
1012
|
+
cmdword_lower = cmdword.lower()
|
|
1013
|
+
|
|
1014
|
+
# Describe statements get special treatment: we first want to
|
|
1015
|
+
# send the request to the server and only when it fails will
|
|
1016
|
+
# we attempt to perform it locally. That's why we don't want
|
|
1017
|
+
# to follow the logic below that starts with parsing.
|
|
1018
|
+
#
|
|
1019
|
+
# The reason for that is changes in Scylla may need to be reflected
|
|
1020
|
+
# in the grammar used in cqlsh. We want Scylla to be "independent"
|
|
1021
|
+
# in that regard, so unless necessary, we don't want to do the parsing
|
|
1022
|
+
# here.
|
|
1023
|
+
if cmdword_lower == 'describe' or cmdword_lower == 'desc':
|
|
1024
|
+
return self.perform_describe(cmdword, tokens, srcstr)
|
|
1025
|
+
|
|
1011
1026
|
custom_handler = getattr(self, 'do_' + cmdword.lower(), None)
|
|
1012
1027
|
if custom_handler:
|
|
1013
1028
|
parsed = cqlruleset.cql_whole_parse_tokens(tokens, srcstr=srcstr,
|
|
@@ -1497,8 +1512,8 @@ class Shell(cmd.Cmd):
|
|
|
1497
1512
|
self.print_recreate_keyspace(k, sys.stdout)
|
|
1498
1513
|
print('')
|
|
1499
1514
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1515
|
+
# Precondition: the first token in `srcstr.lower()` is either `describe` or `desc`.
|
|
1516
|
+
def perform_describe(self, cmdword, tokens, srcstr):
|
|
1502
1517
|
"""
|
|
1503
1518
|
DESCRIBE [cqlsh only]
|
|
1504
1519
|
|
|
@@ -1589,10 +1604,8 @@ class Shell(cmd.Cmd):
|
|
|
1589
1604
|
where object can be either a keyspace or a table or an index or a materialized
|
|
1590
1605
|
view (in this order).
|
|
1591
1606
|
"""
|
|
1592
|
-
self._do_describe(parsed, force_client_side_describe=False)
|
|
1593
1607
|
|
|
1594
|
-
|
|
1595
|
-
if force_client_side_describe:
|
|
1608
|
+
def perform_describe_locally(parsed):
|
|
1596
1609
|
what = parsed.matched[1][1].lower()
|
|
1597
1610
|
if what == 'functions':
|
|
1598
1611
|
self.describe_functions_client(self.current_keyspace)
|
|
@@ -1650,40 +1663,45 @@ class Shell(cmd.Cmd):
|
|
|
1650
1663
|
if not name:
|
|
1651
1664
|
name = self.cql_unprotect_name(parsed.get_binding('mvname', None))
|
|
1652
1665
|
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
1666
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1667
|
+
stmt = SimpleStatement(srcstr, consistency_level=cassandra.ConsistencyLevel.LOCAL_ONE,
|
|
1668
|
+
fetch_size=self.page_size if self.use_paging else None)
|
|
1669
|
+
future = self.session.execute_async(stmt)
|
|
1670
|
+
try:
|
|
1671
|
+
result = future.result()
|
|
1672
|
+
|
|
1673
|
+
# The second token in the statement indicates which
|
|
1674
|
+
# kind of DESCRIBE we're performing.
|
|
1675
|
+
what = srcstr.split()[1].lower().rstrip(';')
|
|
1676
|
+
|
|
1677
|
+
if what in ('columnfamilies', 'tables', 'types', 'functions', 'aggregates'):
|
|
1678
|
+
self.describe_list(result)
|
|
1679
|
+
elif what == 'keyspaces':
|
|
1680
|
+
self.describe_keyspaces(result)
|
|
1681
|
+
elif what == 'cluster':
|
|
1682
|
+
self.describe_cluster(result)
|
|
1683
|
+
elif what:
|
|
1684
|
+
self.describe_element(result)
|
|
1685
|
+
|
|
1686
|
+
except cassandra.protocol.SyntaxException:
|
|
1687
|
+
# Server doesn't support DESCRIBE query, retry with
|
|
1688
|
+
# client-side DESCRIBE implementation
|
|
1689
|
+
parsed = cqlruleset.cql_whole_parse_tokens(tokens, srcstr=srcstr,
|
|
1690
|
+
startsymbol='cqlshCommand')
|
|
1691
|
+
if parsed and not parsed.remainder:
|
|
1692
|
+
return perform_describe_locally(parsed)
|
|
1693
|
+
else:
|
|
1694
|
+
return self.handle_parse_error(cmdword, tokens, parsed, srcstr)
|
|
1695
|
+
except CQL_ERRORS as err:
|
|
1696
|
+
err_msg = err.message if hasattr(err, 'message') else str(err)
|
|
1697
|
+
self.printerr(err_msg.partition("message=")[2].strip('"'))
|
|
1698
|
+
except Exception:
|
|
1699
|
+
import traceback
|
|
1700
|
+
self.printerr(traceback.format_exc())
|
|
1685
1701
|
|
|
1686
|
-
|
|
1702
|
+
if future:
|
|
1703
|
+
if future.warnings:
|
|
1704
|
+
self.print_warnings(future.warnings)
|
|
1687
1705
|
|
|
1688
1706
|
def describe_keyspaces(self, rows):
|
|
1689
1707
|
"""
|
|
@@ -2520,7 +2538,7 @@ def read_options(cmdlineargs, environment):
|
|
|
2520
2538
|
parser.error("Cannot use --cloudconf with hostname or port")
|
|
2521
2539
|
if options.ssl:
|
|
2522
2540
|
parser.error("Cannot use --cloudconf with --ssl. Cloud connection encryption parameters are provided by cloud config bundle.")
|
|
2523
|
-
|
|
2541
|
+
|
|
2524
2542
|
|
|
2525
2543
|
hostname = option_with_default(configs.get, 'connection', 'hostname', DEFAULT_HOST)
|
|
2526
2544
|
port = option_with_default(configs.get, 'connection', 'port', DEFAULT_PORT)
|
|
@@ -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
|
|
@@ -488,7 +488,7 @@ class Shell(cmd.Cmd):
|
|
|
488
488
|
if os.path.exists(self.hostname) and stat.S_ISSOCK(os.stat(self.hostname).st_mode):
|
|
489
489
|
kwargs['contact_points'] = (UnixSocketEndPoint(self.hostname),)
|
|
490
490
|
self.profiles[EXEC_PROFILE_DEFAULT].load_balancing_policy = WhiteListRoundRobinPolicy([UnixSocketEndPoint(self.hostname)])
|
|
491
|
-
else:
|
|
491
|
+
else:
|
|
492
492
|
kwargs['contact_points'] = (self.hostname,)
|
|
493
493
|
self.profiles[EXEC_PROFILE_DEFAULT].load_balancing_policy = WhiteListRoundRobinPolicy([self.hostname])
|
|
494
494
|
kwargs['port'] = self.port
|
|
@@ -1008,6 +1008,21 @@ class Shell(cmd.Cmd):
|
|
|
1008
1008
|
cmdword = tokens[0][1]
|
|
1009
1009
|
if cmdword == '?':
|
|
1010
1010
|
cmdword = 'help'
|
|
1011
|
+
|
|
1012
|
+
cmdword_lower = cmdword.lower()
|
|
1013
|
+
|
|
1014
|
+
# Describe statements get special treatment: we first want to
|
|
1015
|
+
# send the request to the server and only when it fails will
|
|
1016
|
+
# we attempt to perform it locally. That's why we don't want
|
|
1017
|
+
# to follow the logic below that starts with parsing.
|
|
1018
|
+
#
|
|
1019
|
+
# The reason for that is changes in Scylla may need to be reflected
|
|
1020
|
+
# in the grammar used in cqlsh. We want Scylla to be "independent"
|
|
1021
|
+
# in that regard, so unless necessary, we don't want to do the parsing
|
|
1022
|
+
# here.
|
|
1023
|
+
if cmdword_lower == 'describe' or cmdword_lower == 'desc':
|
|
1024
|
+
return self.perform_describe(cmdword, tokens, srcstr)
|
|
1025
|
+
|
|
1011
1026
|
custom_handler = getattr(self, 'do_' + cmdword.lower(), None)
|
|
1012
1027
|
if custom_handler:
|
|
1013
1028
|
parsed = cqlruleset.cql_whole_parse_tokens(tokens, srcstr=srcstr,
|
|
@@ -1497,8 +1512,8 @@ class Shell(cmd.Cmd):
|
|
|
1497
1512
|
self.print_recreate_keyspace(k, sys.stdout)
|
|
1498
1513
|
print('')
|
|
1499
1514
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1515
|
+
# Precondition: the first token in `srcstr.lower()` is either `describe` or `desc`.
|
|
1516
|
+
def perform_describe(self, cmdword, tokens, srcstr):
|
|
1502
1517
|
"""
|
|
1503
1518
|
DESCRIBE [cqlsh only]
|
|
1504
1519
|
|
|
@@ -1589,10 +1604,8 @@ class Shell(cmd.Cmd):
|
|
|
1589
1604
|
where object can be either a keyspace or a table or an index or a materialized
|
|
1590
1605
|
view (in this order).
|
|
1591
1606
|
"""
|
|
1592
|
-
self._do_describe(parsed, force_client_side_describe=False)
|
|
1593
1607
|
|
|
1594
|
-
|
|
1595
|
-
if force_client_side_describe:
|
|
1608
|
+
def perform_describe_locally(parsed):
|
|
1596
1609
|
what = parsed.matched[1][1].lower()
|
|
1597
1610
|
if what == 'functions':
|
|
1598
1611
|
self.describe_functions_client(self.current_keyspace)
|
|
@@ -1650,40 +1663,45 @@ class Shell(cmd.Cmd):
|
|
|
1650
1663
|
if not name:
|
|
1651
1664
|
name = self.cql_unprotect_name(parsed.get_binding('mvname', None))
|
|
1652
1665
|
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
1666
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1667
|
+
stmt = SimpleStatement(srcstr, consistency_level=cassandra.ConsistencyLevel.LOCAL_ONE,
|
|
1668
|
+
fetch_size=self.page_size if self.use_paging else None)
|
|
1669
|
+
future = self.session.execute_async(stmt)
|
|
1670
|
+
try:
|
|
1671
|
+
result = future.result()
|
|
1672
|
+
|
|
1673
|
+
# The second token in the statement indicates which
|
|
1674
|
+
# kind of DESCRIBE we're performing.
|
|
1675
|
+
what = srcstr.split()[1].lower().rstrip(';')
|
|
1676
|
+
|
|
1677
|
+
if what in ('columnfamilies', 'tables', 'types', 'functions', 'aggregates'):
|
|
1678
|
+
self.describe_list(result)
|
|
1679
|
+
elif what == 'keyspaces':
|
|
1680
|
+
self.describe_keyspaces(result)
|
|
1681
|
+
elif what == 'cluster':
|
|
1682
|
+
self.describe_cluster(result)
|
|
1683
|
+
elif what:
|
|
1684
|
+
self.describe_element(result)
|
|
1685
|
+
|
|
1686
|
+
except cassandra.protocol.SyntaxException:
|
|
1687
|
+
# Server doesn't support DESCRIBE query, retry with
|
|
1688
|
+
# client-side DESCRIBE implementation
|
|
1689
|
+
parsed = cqlruleset.cql_whole_parse_tokens(tokens, srcstr=srcstr,
|
|
1690
|
+
startsymbol='cqlshCommand')
|
|
1691
|
+
if parsed and not parsed.remainder:
|
|
1692
|
+
return perform_describe_locally(parsed)
|
|
1693
|
+
else:
|
|
1694
|
+
return self.handle_parse_error(cmdword, tokens, parsed, srcstr)
|
|
1695
|
+
except CQL_ERRORS as err:
|
|
1696
|
+
err_msg = err.message if hasattr(err, 'message') else str(err)
|
|
1697
|
+
self.printerr(err_msg.partition("message=")[2].strip('"'))
|
|
1698
|
+
except Exception:
|
|
1699
|
+
import traceback
|
|
1700
|
+
self.printerr(traceback.format_exc())
|
|
1685
1701
|
|
|
1686
|
-
|
|
1702
|
+
if future:
|
|
1703
|
+
if future.warnings:
|
|
1704
|
+
self.print_warnings(future.warnings)
|
|
1687
1705
|
|
|
1688
1706
|
def describe_keyspaces(self, rows):
|
|
1689
1707
|
"""
|
|
@@ -2520,7 +2538,7 @@ def read_options(cmdlineargs, environment):
|
|
|
2520
2538
|
parser.error("Cannot use --cloudconf with hostname or port")
|
|
2521
2539
|
if options.ssl:
|
|
2522
2540
|
parser.error("Cannot use --cloudconf with --ssl. Cloud connection encryption parameters are provided by cloud config bundle.")
|
|
2523
|
-
|
|
2541
|
+
|
|
2524
2542
|
|
|
2525
2543
|
hostname = option_with_default(configs.get, 'connection', 'hostname', DEFAULT_HOST)
|
|
2526
2544
|
port = option_with_default(configs.get, 'connection', 'port', DEFAULT_PORT)
|