UNPKG

@compas/store

Version:

Postgres & S3-compatible wrappers for common things

88 lines (87 loc) 3.94 kB
/** * Reusable where clause generator. This is used by other generated queries, and can be used inline * in custom queries. * * @param {import("../common/types.js").StoreFileWhere} [where] * @param {{ skipValidator?: boolean, shortName?: string }} [options] * @returns {import("@compas/store").QueryPart<any>} */ export function fileWhere(where?: import("../common/types.js").StoreFileWhere, options?: { skipValidator?: boolean; shortName?: string; }): import("@compas/store").QueryPart<any>; /** * Reusable ORDER BY clause generator. This is used by other generated queries, and can be used * inline in custom queries. * * @param {import("../common/types.js").StoreFileOrderBy} [orderBy] * @param {import("../common/types.js").StoreFileOrderBySpec} [orderBySpec] * @param {{ skipValidator?: boolean, shortName?: string }} [options] * @returns {import("@compas/store").QueryPart<any>} */ export function fileOrderBy(orderBy?: import("../common/types.js").StoreFileOrderBy, orderBySpec?: import("../common/types.js").StoreFileOrderBySpec, options?: { skipValidator?: boolean; shortName?: string; }): import("@compas/store").QueryPart<any>; /** * Query records in the 'file' table, optionally joining related tables. * * @param {import("../common/types.js").StoreFileQueryBuilder} [input] * @returns {import("@compas/store").WrappedQueryPart<import("../common/types.js").QueryResultStoreFile>} */ export function queryFile(input?: import("../common/types.js").StoreFileQueryBuilder): import("@compas/store").WrappedQueryPart<import("../common/types.js").QueryResultStoreFile>; export namespace fileQueries { export { fileCount }; export { fileInsert }; export { fileUpdate }; export { fileDelete }; export { fileUpsertOnId }; } /** @type {any} */ export const fileWhereSpec: any; /** @type {any} */ export const fileQueryBuilderSpec: any; /** * Count the records in the 'file' table * * @param {import("@compas/store").Postgres} sql * @param {import("../common/types.js").StoreFileWhere} where * @returns {Promise<number>} */ declare function fileCount(sql: import("@compas/store").Postgres, where: import("../common/types.js").StoreFileWhere): Promise<number>; /** * Insert a record in the 'file' table * * @param {import("@compas/store").Postgres} sql * @param {import("../common/types.js").StoreFileInsert["insert"]} insert * @param {{ withPrimaryKey?: boolean }} [_options={}] * @returns {Promise<Array<import("../common/types.js").StoreFile>>} */ declare function fileInsert(sql: import("@compas/store").Postgres, insert: import("../common/types.js").StoreFileInsert["insert"], _options?: { withPrimaryKey?: boolean; }): Promise<Array<import("../common/types.js").StoreFile>>; /** * Insert a record in the 'file' table * * @param {import("@compas/store").Postgres} sql * @param {import("../common/types.js").StoreFileUpdate} update * @returns {Promise<Array<import("../common/types.js").StoreFile>>} */ declare function fileUpdate(sql: import("@compas/store").Postgres, update: import("../common/types.js").StoreFileUpdate): Promise<Array<import("../common/types.js").StoreFile>>; /** * Insert a record in the 'file' table * * @param {import("@compas/store").Postgres} sql * @param {import("../common/types.js").StoreFileWhere} [where] * @returns {Promise<void>} */ declare function fileDelete(sql: import("@compas/store").Postgres, where?: import("../common/types.js").StoreFileWhere): Promise<void>; /** * Upsert a record in the 'file' table * * @param {import("@compas/store").Postgres} sql * @param {import("../common/types.js").StoreFileInsert["insert"]} insert * @returns {Promise<Array<import("../common/types.js").StoreFile>>} */ declare function fileUpsertOnId(sql: import("@compas/store").Postgres, insert: import("../common/types.js").StoreFileInsert["insert"]): Promise<Array<import("../common/types.js").StoreFile>>; export {};