scylla-cqlsh 6.0.21__cp39-cp39-win32.whl → 6.0.24__cp39-cp39-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 scylla-cqlsh might be problematic. Click here for more details.

copyutil.cp39-win32.pyd 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
- def do_describe(self, parsed):
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
- def _do_describe(self, parsed, force_client_side_describe):
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
- if future:
1683
- if future.warnings:
1684
- self.print_warnings(future.warnings)
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
- do_desc = do_describe
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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '6.0.21'
16
- __version_tuple__ = version_tuple = (6, 0, 21)
15
+ __version__ = version = '6.0.24'
16
+ __version_tuple__ = version_tuple = (6, 0, 24)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: scylla-cqlsh
3
- Version: 6.0.21
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 >=3.25.10
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,9 +1,9 @@
1
- copyutil.cp39-win32.pyd,sha256=8eicwXWJbnAeeB8rhO--nEQLxmMuBgEbQX4txAvoTqI,1065472
1
+ copyutil.cp39-win32.pyd,sha256=g3p_JOjDaEhy68XC_Ud7jYWUwSbEqDXmpTsjfuFtBKg,1064960
2
2
  cqlsh/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
3
3
  cqlsh/__main__.py,sha256=x2NuvlSuAKwNCxiX07YoYfxog9JNAO759ZxnjBEcfus,231
4
- cqlsh/cqlsh.py,sha256=LdOs8vhjG_oimhOXGoyHd7Ijv6I5Qt0ysWORZrU--Rk,114602
4
+ cqlsh/cqlsh.py,sha256=O8f8owDrWrdwCfJmZrkVtf5sKb-u6QGMKIXl-aCsMhE,115984
5
5
  cqlshlib/__init__.py,sha256=3M0IQCsjdCGYEOBT20swSvqxV6V8vg_mu1uJig78Vmk,3274
6
- cqlshlib/_version.py,sha256=brxR1ufbcy_t7g6J8ADd696yi3jZaiCzJFThbDZ3Sic,429
6
+ cqlshlib/_version.py,sha256=rlFhhwCXM2rN6Xnq6DUgKxgKc5LsmGW2XObL_hvoFtE,429
7
7
  cqlshlib/authproviderhandling.py,sha256=goFjJCO1FKuVCXU7KXlmlorx_cD_oIRlgpOeH13W--g,7254
8
8
  cqlshlib/copyutil.py,sha256=Pc4WaKg_W8IP4ZpuWEvoLOrJJGQTwRHTyOdqExfDro0,116171
9
9
  cqlshlib/cql3handling.py,sha256=NaPViE6v9K4S4ffBmmWzI3_U0Kd-HvBjKq3N6G4GLzI,60790
@@ -18,9 +18,9 @@ cqlshlib/sslhandling.py,sha256=XYdvON1WkWFQ5dg5ttpwpSQDgbqI58YJi8Lx1qTDtQA,4758
18
18
  cqlshlib/tracing.py,sha256=Krb-TkfWrUdxr17-2yZrW5DXKvBEQt-FYZAix_62Tes,3493
19
19
  cqlshlib/util.py,sha256=gHvzlTw1T9N1YzXdVPFptAt58EzyXpDRibAo8QB03I8,5240
20
20
  cqlshlib/wcwidth.py,sha256=zsoo9u3ZA3q8RL5Afb6ynRujqDdUZ9zlFIHGE8RkqyA,16244
21
- scylla_cqlsh-6.0.21.dist-info/LICENSE.txt,sha256=65AZdlqRQxiyMBv8nY6itMITk5jx9EkE_jHujbcDzbk,11564
22
- scylla_cqlsh-6.0.21.dist-info/METADATA,sha256=ZFY2SP2ltrXaofw_ABIzC_uH-l3R_1iILkIv5KB6jSw,2910
23
- scylla_cqlsh-6.0.21.dist-info/WHEEL,sha256=e2yVuGd3wZeuy2lP4K6Jh17Z-_8KJJrhwZSE45Du-Jc,95
24
- scylla_cqlsh-6.0.21.dist-info/entry_points.txt,sha256=oE4unqgR3WwNkCJDGlMG1HYtCE3nEZZ4d9CIl-JSZyQ,46
25
- scylla_cqlsh-6.0.21.dist-info/top_level.txt,sha256=PVG-5w7PDG3FoAJH6Rq2I8C0y4cKa2KOW75GxjHkmQ4,24
26
- scylla_cqlsh-6.0.21.dist-info/RECORD,,
21
+ scylla_cqlsh-6.0.24.dist-info/LICENSE.txt,sha256=65AZdlqRQxiyMBv8nY6itMITk5jx9EkE_jHujbcDzbk,11564
22
+ scylla_cqlsh-6.0.24.dist-info/METADATA,sha256=UGhBlc7BZUrVAa-8zhSsR0ngdBNeTgGnhMEf8dQ5D_4,3215
23
+ scylla_cqlsh-6.0.24.dist-info/WHEEL,sha256=nit2jk1XD9iB81u5goYHy9pLj6BDgJHNYHDLr0P5SFs,95
24
+ scylla_cqlsh-6.0.24.dist-info/entry_points.txt,sha256=oE4unqgR3WwNkCJDGlMG1HYtCE3nEZZ4d9CIl-JSZyQ,46
25
+ scylla_cqlsh-6.0.24.dist-info/top_level.txt,sha256=PVG-5w7PDG3FoAJH6Rq2I8C0y4cKa2KOW75GxjHkmQ4,24
26
+ scylla_cqlsh-6.0.24.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-win32
5
5