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 {
    batchSize?: number;
    indices?: Index[];
    keyspace: string;
    maxConcurrency?: number;
    maxRetries?: number;
    nonKeyColumns: Column | Column[];
    onFailedAttempt?: FailedAttemptHandler;
    primaryKey: Column | Column[];
    table: string;
    withClause?: string;
}

Hierarchy

  • AsyncCallerParams
    • CassandraTableArgs

Properties

batchSize?: number
indices?: Index[]
keyspace: string
maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

nonKeyColumns: Column | Column[]
onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

primaryKey: Column | Column[]
table: string
withClause?: string