import MongoDBQueryBuilder from './MongoDBQueryBuilder'; import MongoDBFilterBuilder from './MongoDBFilterBuilder'; import { Fetch, GenericSchema } from './types'; export default class MongoDBClient { url: string; headers: Record; schemaName?: SchemaName; fetch?: Fetch; constructor(url: string, { headers, schema, fetch, }?: { headers?: Record; schema?: SchemaName; fetch?: Fetch; }); from(relation: TableName): MongoDBQueryBuilder; from(relation: ViewName): MongoDBQueryBuilder; /** * Select a schema to query or perform an function (rpc) call. * * The schema needs to be on the list of exposed schemas inside Pasubot. * * @param schema - The schema to query */ schema(schema: DynamicSchema): MongoDBClient; /** * Perform a function call. * * @param fn - The function name to call * @param args - The arguments to pass to the function call * @param options - Named parameters * @param options.head - When set to `true`, `data` will not be returned. * Useful if you only need the count. * @param options.get - When set to `true`, the function will be called with * read-only access mode. * @param options.count - Count algorithm to use to count rows returned by the * function. Only applicable for [set-returning * functions](https://www.postgresql.org/docs/current/functions-srf.html). * * `"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the * hood. * * `"planned"`: Approximated but fast count algorithm. Uses the Postgres * statistics under the hood. * * `"estimated"`: Uses exact count for low numbers and planned count for high * numbers. */ rpc(fn: FnName, args?: Fn['Args'], { head, get, count, }?: { head?: boolean; get?: boolean; count?: 'exact' | 'planned' | 'estimated'; }): MongoDBFilterBuilder ? Fn['Returns'][number] : never : never, Fn['Returns']>; } //# sourceMappingURL=MongoDBClient.d.ts.map