@hotmeshio/hotmesh
Version:
Permanent-Memory Workflows & AI Agents
38 lines (37 loc) • 2.04 kB
TypeScript
import { SearchService } from '../../index';
import { ILogger } from '../../../logger';
import { PostgresClientType } from '../../../../types/postgres';
import { ProviderClient, ProviderTransaction } from '../../../../types/provider';
declare class PostgresSearchService extends SearchService<PostgresClientType & ProviderClient> {
pgClient: PostgresClientType;
transact(): ProviderTransaction;
constructor(searchClient: PostgresClientType & ProviderClient, storeClient?: PostgresClientType & ProviderClient);
init(namespace: string, appId: string, logger: ILogger): Promise<void>;
createSearchIndex(indexName: string, prefixes: string[], schema: string[]): Promise<void>;
listSearchIndexes(): Promise<string[]>;
updateContext(key: string, fields: Record<string, string>): Promise<any>;
setFields(key: string, fields: Record<string, string>): Promise<any>;
getField(key: string, field: string): Promise<string>;
getFields(key: string, fields: string[]): Promise<string[]>;
getAllFields(key: string): Promise<Record<string, string>>;
deleteFields(key: string, fields: string[]): Promise<number>;
incrementFieldByFloat(key: string, field: string, increment: number): Promise<number>;
sendQuery(query: string): Promise<any>;
/**
* assume aggregation type query
*/
sendIndexedQuery(type: string, queryParams?: any[]): Promise<any[]>;
findEntities(entity: string, conditions: Record<string, any>, options?: {
limit?: number;
offset?: number;
}): Promise<any[]>;
findEntityById(entity: string, id: string): Promise<any>;
findEntitiesByCondition(entity: string, field: string, value: any, operator?: '=' | '!=' | '>' | '<' | '>=' | '<=' | 'LIKE' | 'IN', options?: {
limit?: number;
offset?: number;
}): Promise<any[]>;
createEntityIndex(entity: string, field: string, indexType?: 'btree' | 'gin' | 'gist'): Promise<void>;
private mongoToSqlOperator;
private inferType;
}
export { PostgresSearchService };