/** * Cassandra Adapter * * Database adapter for Apache Cassandra using the 'cassandra-driver' library. * Implements all methods from BaseAdapter with Cassandra-specific operations. * * Key Cassandra concepts: * - Keyspace (like a database/schema) * - Column family/Table * - Partition key and clustering columns * - No JOINs - denormalized data model * - No transactions in the traditional sense (uses lightweight transactions) * - Eventual consistency by default */ import { BaseAdapter, DatabaseFeature } from './base.adapter'; import { DatabaseType, IsolationLevel } from '../types/enums'; import { IAdapterConnectionOptions, IAdapterConnectionResult } from '../types/connection.interface'; import { IQueryResult, IRawQueryOptions, IRawQueryResult, IBuiltQuery } from '../types/query.interface'; import { IInsertOptions, IInsertResult, IUpdateOptions, IUpdateResult, IDeleteOptions, IDeleteResult, IUpsertOptions, IUpsertResult } from '../types/write.interface'; import { ITransactionContext, ISavepoint } from '../types/transaction.interface'; import { ICountOptions, ISumOptions, IAvgOptions, IMinMaxOptions, IAggregateResult, IGroupByResult, IBuiltAggregation } from '../types/aggregation.interface'; import { ITableDefinition, IAlterTableOperation, ITableSchema, ITableInfo, IIndexDefinition, IIndexInfo, IIndexStatistics, ICreateTableOptions } from '../types/schema.interface'; /** * Cassandra database adapter * Provides Cassandra-specific implementations for all database operations */ export declare class CassandraAdapter extends BaseAdapter { protected readonly databaseType = DatabaseType.CASSANDRA; private cassandraClient; private keyspace; connect(options: IAdapterConnectionOptions): Promise; testConnection(options: IAdapterConnectionOptions): Promise; disconnect(): Promise; query(query: IBuiltQuery): Promise>; raw(options: IRawQueryOptions): Promise>; insert(options: IInsertOptions): Promise>; update(options: IUpdateOptions): Promise>; delete(options: IDeleteOptions): Promise; upsert(options: IUpsertOptions): Promise>; count(options: ICountOptions): Promise; sum(options: ISumOptions): Promise; avg(options: IAvgOptions): Promise; min(options: IMinMaxOptions): Promise; max(options: IMinMaxOptions): Promise; aggregate(builtAggregation: IBuiltAggregation): Promise; groupBy(builtGroupBy: IBuiltAggregation): Promise[]>; beginTransaction(isolationLevel?: IsolationLevel, readOnly?: boolean, timeout?: number): Promise; commitTransaction(context: ITransactionContext): Promise; rollbackTransaction(context: ITransactionContext): Promise; createSavepoint(context: ITransactionContext, name: string): Promise; releaseSavepoint(context: ITransactionContext, savepoint: ISavepoint): Promise; rollbackToSavepoint(context: ITransactionContext, savepoint: ISavepoint): Promise; supportsSavepoints(): boolean; createTable(definition: ITableDefinition, options?: ICreateTableOptions): Promise; alterTable(tableName: string, operations: IAlterTableOperation[]): Promise; dropTable(tableName: string, ifExists?: boolean, cascade?: boolean): Promise; listTables(): Promise; listTablesWithInfo(): Promise; tableExists(tableName: string): Promise; getTableSchema(tableName: string): Promise; createIndex(index: IIndexDefinition, ifNotExists?: boolean, concurrent?: boolean): Promise; dropIndex(tableName: string, indexName: string, ifExists?: boolean, concurrent?: boolean, cascade?: boolean): Promise; listIndexes(tableName: string, includeSystem?: boolean): Promise; getIndexStatistics(tableName: string, indexName?: string): Promise; escapeIdentifier(identifier: string): string; escapeValue(value: any): string; /** * Check if value is an update operator object * Supports both lowercase (new) and uppercase (legacy) operators */ private isUpdateOperator; getParameterPlaceholder(index: number): string; getColumnTypeString(columnType: string, options?: { minLength?: number; maxLength?: number; precision?: number; scale?: number; enumValues?: string[]; arrayType?: string; }): string; getSupportedFeatures(): DatabaseFeature[]; parseError(error: any): { type: string; message: string; code?: string; details?: Record; }; private ensureConnected; private getClusterVersion; private buildWhereClause; private buildColumnDefinition; }