/** * Format and append query parts, and execute the final result in a safe way. * Undefined values are skipped, as they are not allowed in queries. * The query call may be one of the interpolated values. Supports being called as a * template literal. * * @since 0.1.0 * * @template T * * @param {TemplateStringsArray | Array} strings * @param {...(import("../types/advanced-types.d.ts").QueryPartArg * | Array * )} values * @returns {import("../types/advanced-types.d.ts").QueryPart} */ export function query(strings: TemplateStringsArray | Array, ...values: (import("../types/advanced-types.d.ts").QueryPartArg | Array)[]): import("../types/advanced-types.d.ts").QueryPart; /** * Check if the passed in value is an object generated by 'query``'. * * @since 0.1.0 * * @param {any} query * @returns {query is import("../types/advanced-types.d.ts").QueryPart} */ export function isQueryPart(query: any): query is import("../types/advanced-types.d.ts").QueryPart; /** * Stringify a queryPart. * When interpolateParameters is true, we do a best effort in replacing the parameterized * query with the real params. If the result doesn't look right, please turn it off. * * @since 0.1.0 * * @param {import("../types/advanced-types.d.ts").QueryPart} queryPart * @param {{ interpolateParameters?: boolean }} options * @returns {string | {sql?: string, params?: Array<*>}} */ export function stringifyQueryPart(queryPart: import("../types/advanced-types.d.ts").QueryPart, { interpolateParameters }?: { interpolateParameters?: boolean; }): string | { sql?: string; params?: Array; }; /** * Creates a transaction, executes the query, and rollback the transaction afterwards. * This is safe to use with insert, update and delete queries. * * By default returns text, but can also return json. * Note that explain output is highly depended on the current data and usage of the * tables. * * @since 0.1.0 * * @param {import("postgres").Sql<{}>} sql * @param {import("../types/advanced-types.d.ts").QueryPart} queryItem * @param {{ jsonResult?: boolean }} [options={}] * @returns {Promise} */ export function explainAnalyzeQuery(sql: import("postgres").Sql<{}>, queryItem: import("../types/advanced-types.d.ts").QueryPart, { jsonResult }?: { jsonResult?: boolean; }): Promise;