scylla-cqlsh 6.0.21__cp39-cp39-win32.whl → 6.0.23__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
@@ -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
- def do_describe(self, parsed):
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
- def _do_describe(self, parsed, force_client_side_describe):
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
- if future:
1683
- if future.warnings:
1684
- self.print_warnings(future.warnings)
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
- do_desc = do_describe
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)
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.23'
16
+ __version_tuple__ = version_tuple = (6, 0, 23)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: scylla-cqlsh
3
- Version: 6.0.21
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
@@ -17,7 +17,7 @@ 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
21
 
22
22
  # scylla-cqlsh
23
23
 
@@ -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
 
@@ -1,9 +1,9 @@
1
- copyutil.cp39-win32.pyd,sha256=8eicwXWJbnAeeB8rhO--nEQLxmMuBgEbQX4txAvoTqI,1065472
1
+ copyutil.cp39-win32.pyd,sha256=l4igJtWH4U8L-Jx3s8D0eYMUriP0a5U3dQkKUFjkVzQ,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=bvywNlqREXkvbUehQ-KeSwz2Vp-PqEPgHZ3F1aVlZNs,115547
5
5
  cqlshlib/__init__.py,sha256=3M0IQCsjdCGYEOBT20swSvqxV6V8vg_mu1uJig78Vmk,3274
6
- cqlshlib/_version.py,sha256=brxR1ufbcy_t7g6J8ADd696yi3jZaiCzJFThbDZ3Sic,429
6
+ cqlshlib/_version.py,sha256=ZQpkrXVMWsTfh96zRjaleuSwBuNkwJEjgwzz3x3igjY,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.23.dist-info/LICENSE.txt,sha256=65AZdlqRQxiyMBv8nY6itMITk5jx9EkE_jHujbcDzbk,11564
22
+ scylla_cqlsh-6.0.23.dist-info/METADATA,sha256=txm-kq0Fw-5UTh6q04mOva0_Wd6FLsSc65mQAl_2rSo,3152
23
+ scylla_cqlsh-6.0.23.dist-info/WHEEL,sha256=Ri4o4wt5NUPNLrgMkcmnVM5I7CjJ2bK3UNXJn7clgaM,95
24
+ scylla_cqlsh-6.0.23.dist-info/entry_points.txt,sha256=oE4unqgR3WwNkCJDGlMG1HYtCE3nEZZ4d9CIl-JSZyQ,46
25
+ scylla_cqlsh-6.0.23.dist-info/top_level.txt,sha256=PVG-5w7PDG3FoAJH6Rq2I8C0y4cKa2KOW75GxjHkmQ4,24
26
+ scylla_cqlsh-6.0.23.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.1.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-win32
5
5