import type { PGQuery } from './client'; /** * A _function_ capable of converting a template string into a {@link PGQuery} * like structure (tagged template literals). * * For example: * * ```typescript * const email = 'user@example.org' * const query = SQL `SELECT * FROM users WHERE email = ${email}` * * // Here "query" will be something like: * // { * // query: 'SELECT * FROM users WHERE email = $1', * // params: [ 'user@example.org' ], * // } * ``` * * The `SQL` function can also be use with _concatenated_ template strings, for * example: * * ```typescript * const email = 'user@example.org' * const hash = 'thePasswordHash' * const query = SQL * `SELECT * FROM users WHERE email = ${email}` * `AND password_hash = ${hash}` * * // Here "query" will be something like: * // { * // query: 'SELECT * FROM users WHERE email = $1 AND password_hash = $2', * // params: [ 'user@example.org', 'thePasswordHash' ], * // } * ``` * * In this case, multiple template strings will be concatenated with a single * space character. */ export interface SQL extends Required { (strings: readonly string[], ...args: any[]): SQL; } /** * A _function_ capable of converting a template string into a {@link PGQuery} * like structure (tagged template literals). * * For example: * * ```typescript * const email = 'user@example.org' * const query = SQL `SELECT * FROM users WHERE email = ${email}` * * // Here "query" will be something like: * // { * // query: 'SELECT * FROM users WHERE email = $1', * // params: [ 'user@example.org' ], * // } * ``` * * The `SQL` function can also be use with _concatenated_ template strings, for * example: * * ```typescript * const email = 'user@example.org' * const hash = 'thePasswordHash' * const query = SQL * `SELECT * FROM users WHERE email = ${email}` * `AND password_hash = ${hash}` * * // Here "query" will be something like: * // { * // query: 'SELECT * FROM users WHERE email = $1 AND password_hash = $2', * // params: [ 'user@example.org', 'thePasswordHash' ], * // } * ``` * * In this case, multiple template strings will be concatenated with a single * space character. */ export declare function SQL(strings: readonly string[], ...args: readonly any[]): SQL; /** Escape a PostgreSQL identifier (table, column, ... names) */ export declare function escape(str: string): string;