Defines the configuration arguments for initializing a Cassandra table within an application. This interface extends AsyncCallerParams, incorporating asynchronous operation configurations, and adds specific properties for table creation, query execution, and data manipulation in a Cassandra database context.

Properties:

  • table: The name of the table to be used or created.
  • keyspace: The keyspace within which the table exists or will be created.
  • primaryKey: Specifies the column(s) that constitute the primary key of the table. This can be a single Column object for a simple primary key or an array of Column objects for composite keys.
  • nonKeyColumns: Defines columns that are not part of the primary key. Similar to primaryKey, this can be a single Column object or an array of Column objects, supporting flexible table schema definitions.
  • withClause: Optional. A string containing additional CQL table options to be included in the CREATE TABLE statement. This enables the specification of various table behaviors and properties, such as compaction strategies and TTL settings.
  • indices: Optional. An array of Index objects defining secondary indices on the table for improved query performance on non-primary key columns.
  • batchSize: Optional. Specifies the default size of batches for batched write operations to the table, affecting performance and consistency trade-offs.
interface CassandraTableArgs {
    keyspace: string;
    nonKeyColumns: Column | Column[];
    primaryKey: Column | Column[];
    table: string;
    batchSize?: number;
    indices?: Index[];
    withClause?: string;
}

Hierarchy (view full)

Properties

keyspace: string
nonKeyColumns: Column | Column[]
primaryKey: Column | Column[]
table: string
batchSize?: number
indices?: Index[]
withClause?: string