@compas/store
Version:
Postgres & S3-compatible wrappers for common things
88 lines (87 loc) • 3.89 kB
TypeScript
/**
* Reusable where clause generator. This is used by other generated queries, and can be used inline
* in custom queries.
*
* @param {import("../common/types.js").StoreJobWhere} [where]
* @param {{ skipValidator?: boolean, shortName?: string }} [options]
* @returns {import("@compas/store").QueryPart<any>}
*/
export function jobWhere(where?: import("../common/types.js").StoreJobWhere, 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").StoreJobOrderBy} [orderBy]
* @param {import("../common/types.js").StoreJobOrderBySpec} [orderBySpec]
* @param {{ skipValidator?: boolean, shortName?: string }} [options]
* @returns {import("@compas/store").QueryPart<any>}
*/
export function jobOrderBy(orderBy?: import("../common/types.js").StoreJobOrderBy, orderBySpec?: import("../common/types.js").StoreJobOrderBySpec, options?: {
skipValidator?: boolean;
shortName?: string;
}): import("@compas/store").QueryPart<any>;
/**
* Query records in the 'job' table, optionally joining related tables.
*
* @param {import("../common/types.js").StoreJobQueryBuilder} [input]
* @returns {import("@compas/store").WrappedQueryPart<import("../common/types.js").QueryResultStoreJob>}
*/
export function queryJob(input?: import("../common/types.js").StoreJobQueryBuilder): import("@compas/store").WrappedQueryPart<import("../common/types.js").QueryResultStoreJob>;
export namespace jobQueries {
export { jobCount };
export { jobInsert };
export { jobUpdate };
export { jobDelete };
export { jobUpsertOnId };
}
/** @type {any} */
export const jobWhereSpec: any;
/** @type {any} */
export const jobQueryBuilderSpec: any;
/**
* Count the records in the 'job' table
*
* @param {import("@compas/store").Postgres} sql
* @param {import("../common/types.js").StoreJobWhere} where
* @returns {Promise<number>}
*/
declare function jobCount(sql: import("@compas/store").Postgres, where: import("../common/types.js").StoreJobWhere): Promise<number>;
/**
* Insert a record in the 'job' table
*
* @param {import("@compas/store").Postgres} sql
* @param {import("../common/types.js").StoreJobInsert["insert"]} insert
* @param {{ withPrimaryKey?: boolean }} [_options={}]
* @returns {Promise<Array<import("../common/types.js").StoreJob>>}
*/
declare function jobInsert(sql: import("@compas/store").Postgres, insert: import("../common/types.js").StoreJobInsert["insert"], _options?: {
withPrimaryKey?: boolean;
}): Promise<Array<import("../common/types.js").StoreJob>>;
/**
* Insert a record in the 'job' table
*
* @param {import("@compas/store").Postgres} sql
* @param {import("../common/types.js").StoreJobUpdate} update
* @returns {Promise<Array<import("../common/types.js").StoreJob>>}
*/
declare function jobUpdate(sql: import("@compas/store").Postgres, update: import("../common/types.js").StoreJobUpdate): Promise<Array<import("../common/types.js").StoreJob>>;
/**
* Insert a record in the 'job' table
*
* @param {import("@compas/store").Postgres} sql
* @param {import("../common/types.js").StoreJobWhere} [where]
* @returns {Promise<void>}
*/
declare function jobDelete(sql: import("@compas/store").Postgres, where?: import("../common/types.js").StoreJobWhere): Promise<void>;
/**
* Upsert a record in the 'job' table
*
* @param {import("@compas/store").Postgres} sql
* @param {import("../common/types.js").StoreJobInsert["insert"]} insert
* @returns {Promise<Array<import("../common/types.js").StoreJob>>}
*/
declare function jobUpsertOnId(sql: import("@compas/store").Postgres, insert: import("../common/types.js").StoreJobInsert["insert"]): Promise<Array<import("../common/types.js").StoreJob>>;
export {};