Table#

class langchain_community.utilities.cassandra_database.Table[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param clustering: List[Tuple[str, str]] [Optional]#
param columns: List[Tuple[str, str]] [Optional]#
param comment: str | None = None#

The comment associated with the table.

param indexes: List[Tuple[str, str, str]] [Optional]#
param keyspace: str [Required]#

The keyspace in which the table exists.

param partition: List[str] [Optional]#
param table_name: str [Required]#

The name of the table.

as_markdown(include_keyspace: bool = True, header_level: int | None = None) str[source]#

Generates a Markdown representation of the Cassandra table schema, allowing for customizable header levels for the table name section.

Parameters:
  • include_keyspace (bool) – If True, includes the keyspace in the output. Defaults to True.

  • header_level (int | None) – Specifies the markdown header level for the table name. If None, the table name is included without a header. Defaults to None (no header level).

Returns:

A string in Markdown format detailing the table name (with optional header level), keyspace (optional), comment, columns, partition keys, clustering keys (with optional clustering order), and indexes.

Return type:

str

classmethod from_database(keyspace: str, table_name: str, db: CassandraDatabase) Table[source]#
Parameters:
Return type:

Table