1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.toSqlParams = void 0;
|
4 | /**
|
5 | * Allows for using strings and `sql-template-strings`. Converts both to a
|
6 | * format that's usable by the SQL methods
|
7 | *
|
8 | * @param sql A SQL string or `sql-template-strings` object
|
9 | * @param params An array of parameters
|
10 | */
|
11 | function toSqlParams(sql, params = []) {
|
12 | if (typeof sql === 'string') {
|
13 | return {
|
14 | sql,
|
15 | params
|
16 | };
|
17 | }
|
18 | return {
|
19 | sql: sql.sql,
|
20 | params: sql.values
|
21 | };
|
22 | }
|
23 | exports.toSqlParams = toSqlParams;
|
24 | //# sourceMappingURL=strings.js.map |
\ | No newline at end of file |