Represents a Cassandra table, encapsulating functionality for schema definition, data manipulation, and querying. This class provides a high-level abstraction over Cassandra's table operations, including creating tables, inserting, updating, selecting, and deleting records. It leverages the CassandraClient for executing operations and supports asynchronous interactions with the database.
Key features include:
The class is designed to be instantiated with a set of configuration arguments (CassandraTableArgs)
that define the table's structure and operational parameters, providing a streamlined interface for
interacting with Cassandra tables in a structured and efficient manner.
Usage Example:
const tableArgs: CassandraTableArgs = {
table: 'my_table',
keyspace: 'my_keyspace',
primaryKey: [{ name: 'id', type: 'uuid', partition: true }],
nonKeyColumns: [{ name: 'data', type: 'text' }],
};
const cassandraClient = new CassandraClient(clientConfig);
const myTable = new CassandraTable(tableArgs, cassandraClient);
This class simplifies Cassandra database interactions, making it easier to perform robust data operations while maintaining clear separation of concerns and promoting code reusability.
class CassandraTable