/** * DynamoDB Adapter * * Database adapter for AWS DynamoDB using the '@aws-sdk/client-dynamodb' and * '@aws-sdk/lib-dynamodb' libraries. * Implements all methods from BaseAdapter with DynamoDB-specific operations. * * Note: DynamoDB is a NoSQL key-value store with different concepts: * - Tables have a partition key (and optional sort key) * - No traditional transactions (uses TransactWriteItems/TransactGetItems) * - No savepoints * - Different query patterns than SQL databases */ 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'; /** * DynamoDB database adapter * Provides DynamoDB-specific implementations for all database operations */ export declare class DynamoDBAdapter extends BaseAdapter { protected readonly databaseType = DatabaseType.DYNAMODB; private dynamoClient; private docClient; private region; 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 buildFilterExpression; private buildUpdateExpression; /** * Extract key condition from where clause if partition key is present. * This enables using Query instead of Scan for better performance. */ private extractKeyCondition; /** * Get simple value from where clause for a specific field */ private getWhereValue; /** * Get operator and value from where clause for a specific field */ private getWhereOperator; private getTableKey; private waitForTableActive; private mapToDynamoType; private mapFromDynamoType; private chunkArray; private formatBytes; }