import type { AbstractDialect, BindCollector } from '../abstract-dialect/dialect.js'; import type { AddLimitOffsetOptions } from '../abstract-dialect/query-generator.internal-types.js'; import type { AbstractQueryGenerator } from '../abstract-dialect/query-generator.js'; import type { BindOrReplacements, QueryRawOptions, Sequelize } from '../sequelize.js'; type MapSqlOptions = { onPositionalReplacement?(): void; }; /** * Maps bind parameters from Sequelize's format ($1 or $name) to the dialect's format. * * @param sqlString * @param dialect */ export declare function mapBindParameters(sqlString: string, dialect: AbstractDialect): { sql: string; bindOrder: string[] | null; parameterSet: Set; }; export declare function injectReplacements(sqlString: string, dialect: AbstractDialect, replacements: BindOrReplacements, opts?: MapSqlOptions): string; /** * Collector for dialects that only support ordered parameters, and whose order matter in the SQL query. (e.g. dialects that use the "?" token for parameters) * * @param token The token to use as the bind parameter (e.g. '?' in mysql). */ export declare function createUnspecifiedOrderedBindCollector(token?: string): BindCollector; /** * Collector for dialects that only support ordered parameters, but whose order does not matter in the SQL query (e.g. dialect that support parameters names like '$1') * * Parameter index starts at 1! * * @param prefix The prefix to place before the name of the bind parameter (e.g. @ for mssql, $ for sqlite/postgres) */ export declare function createSpecifiedOrderedBindCollector(prefix?: string): BindCollector; /** * Collector for dialects that support named bind parameters (e.g. @name, $name, etc) * * @param parameterPrefix The prefix to place before the name of the bind parameter (e.g. @ for mssql, $ for sqlite/postgres) */ export declare function createNamedParamBindCollector(parameterPrefix: string): BindCollector; export declare function assertNoReservedBind(bind: BindOrReplacements): void; export declare function combineBinds(bindA: BindOrReplacements, bindB: { [key: string]: unknown; }): { [x: string]: unknown; }; export declare function escapeMysqlMariaDbString(value: string): string; export declare function formatDb2StyleLimitOffset(options: AddLimitOffsetOptions, queryGenerator: AbstractQueryGenerator): string; export declare function formatMySqlStyleLimitOffset(options: AddLimitOffsetOptions, queryGenerator: AbstractQueryGenerator): string; export declare function withSqliteForeignKeysOff(sequelize: Sequelize, options: QueryRawOptions | undefined, cb: () => Promise): Promise; /** * Creates a function that can be used to collect bind parameters. * * @param bind A mutable object to which bind parameters will be added. * @param preserveNumbering (optional) It retains the previous bind position value. */ export declare function createBindParamGenerator(bind: Record, preserveNumbering?: boolean): (value: unknown) => string; export {}; //# sourceMappingURL=sql.d.ts.map