import { IDatabaseConnection } from './IDatabaseConnection'; import { IQueryable } from './IQueryable'; export declare abstract class Query implements IQueryable { private $params; constructor(parameters?: TQueryParameters); /** * @returns parameters that was passed into the constructor. */ getParameters(): TQueryParameters; /** * Query implementations may override this API to augment the parameters. * * @returns parameters that will be used when this query is ran. */ getParametersForQuery(): Record; protected abstract _getQuery(connection: IDatabaseConnection): string; getQuery(connection: IDatabaseConnection): string; /** * Overridable to execute statements before the main query. * Can be used to set session variables or create temporary tables, etc. * * @param connection * @returns */ onPreQuery(connection: IDatabaseConnection): Promise; /** * Overridable to execute statements after the main query. * Can be used to clean up session variables or temporary tables, etc * * Unlike {@link onPostProcess}, this hook does not provide the result set, * and will be invoked even if the main query produces an error. * * @since 8.3.0 * * @param connection * @returns {void} */ onPostQuery(connection: IDatabaseConnection): Promise; /** * Override to augment/manipulate the returned result set. * * @deprecated - Streaming queries does not support post processing, creating a confusing API * * @param connection The connection object used for this query execution. Useful if further queries are required. * @param resultset The original result set */ onPostProcess(connection: IDatabaseConnection, resultSet: TQueryResultSet): Promise; execute(connection: IDatabaseConnection): Promise; }