MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / _property_string

Method _property_string

cassandra/metadata.py:1400–1419  ·  view source on GitHub ↗
(cls, formatted, clustering_key, options_map, is_compact_storage=False)

Source from the content-addressed store, hash-verified

1398
1399 @classmethod
1400 def _property_string(cls, formatted, clustering_key, options_map, is_compact_storage=False):
1401 properties = []
1402 if is_compact_storage:
1403 properties.append("COMPACT STORAGE")
1404
1405 if clustering_key:
1406 cluster_str = "CLUSTERING ORDER BY "
1407
1408 inner = []
1409 for col in clustering_key:
1410 ordering = "DESC" if col.is_reversed else "ASC"
1411 inner.append("%s %s" % (protect_name(col.name), ordering))
1412
1413 cluster_str += "(%s)" % ", ".join(inner)
1414 properties.append(cluster_str)
1415
1416 properties.extend(cls._make_option_strings(options_map))
1417
1418 join_str = "\n AND " if formatted else " AND "
1419 return join_str.join(properties)
1420
1421 @classmethod
1422 def _make_option_strings(cls, options_map):

Callers 2

as_cql_queryMethod · 0.95
as_cql_queryMethod · 0.80

Calls 2

protect_nameFunction · 0.85
_make_option_stringsMethod · 0.45

Tested by

no test coverage detected