import { IndexableObject, AnError, PartitionKeyQuery } from '../core/domain'; import { Client } from 'cassandra-driver'; import { IRepository } from './repository.interface'; export interface MissingPartitionKeys extends AnError { keys: string[]; } export declare function normalizeQueryText(queryText: string): string; export declare class Repository implements IRepository { private readonly entityCtor; private readonly metadata; private readonly client; private readonly partitionKeys; private readonly clusteringKeys; constructor(client: Client, entityCtor: Function); /** * Gets an entity by partition key or all entities from a partition key * depending on whether or not clustering keys are available on the table * * Clustering keys can be provided and will be executed if they match clustering * keys defined on the entity decorator. Values must be provided that match left to right * specificity in order for the query to be valid. * * @param keys An object map whose keys and values should correspond to partition keys * and their values respectively. Keys for all the selected partition key properties from * the entity decorator must be supplied, otherwise a failure will be returned. */ getFromPartition(query: PartitionKeyQuery): Promise[] | MissingPartitionKeys>; insert(entity: T): Promise; deleteOne(query: PartitionKeyQuery): Promise; deleteMany(query: PartitionKeyQuery): Promise; private validatePartitionKeys(query); private validateClusteringKeys(candidate); }