joist-core 2.3.0-next.84 → 2.3.0-next.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/query.cjs CHANGED
@@ -117,20 +117,32 @@ function recursiveQuery(name, base, step, opts = {}) {
117
117
  * ```
118
118
  */
119
119
  function sql(strings, ...values) {
120
- return new require_Expr.TemplateExpr(strings, values);
120
+ return typedSql(strings, ...values);
121
121
  }
122
122
  /** Shorthand for `sql<number>`; does not cast or convert the SQL result. */
123
- sql.number = sql;
123
+ sql.number = typedSql;
124
124
  /** Shorthand for `sql<number | null>`; does not cast or convert the SQL result. */
125
- sql.numberOrNull = sql;
125
+ sql.numberOrNull = typedSql;
126
+ /** Shorthand for `sql<number[]>`; does not cast or convert the SQL result. */
127
+ sql.numberArray = typedSql;
128
+ /** Shorthand for `sql<number[] | null>`; does not cast or convert the SQL result. */
129
+ sql.numberArrayOrNull = typedSql;
126
130
  /** Shorthand for `sql<string>`; does not cast or convert the SQL result. */
127
- sql.string = sql;
131
+ sql.string = typedSql;
128
132
  /** Shorthand for `sql<string | null>`; does not cast or convert the SQL result. */
129
- sql.stringOrNull = sql;
133
+ sql.stringOrNull = typedSql;
134
+ /** Shorthand for `sql<string[]>`; does not cast or convert the SQL result. */
135
+ sql.stringArray = typedSql;
136
+ /** Shorthand for `sql<string[] | null>`; does not cast or convert the SQL result. */
137
+ sql.stringArrayOrNull = typedSql;
130
138
  /** Shorthand for `sql<boolean>`; does not cast or convert the SQL result. */
131
- sql.boolean = sql;
139
+ sql.boolean = typedSql;
132
140
  /** Shorthand for `sql<boolean | null>`; does not cast or convert the SQL result. */
133
- sql.booleanOrNull = sql;
141
+ sql.booleanOrNull = typedSql;
142
+ /** Shorthand for `sql<boolean[]>`; does not cast or convert the SQL result. */
143
+ sql.booleanArray = typedSql;
144
+ /** Shorthand for `sql<boolean[] | null>`; does not cast or convert the SQL result. */
145
+ sql.booleanArrayOrNull = typedSql;
134
146
  /** A raw condition for `where`, `having`, or `on`. */
135
147
  sql.condition = function condition(strings, ...values) {
136
148
  return require_Expr.deferredCondition((ctx) => new require_Expr.TemplateExpr(strings, values).toSql(ctx));
@@ -1330,6 +1342,10 @@ function joinFragmentParts(parts, sep) {
1330
1342
  function isDefined(value) {
1331
1343
  return value !== void 0;
1332
1344
  }
1345
+ /** Keeps shorthand declarations callable-only, without recursively copying sql's own shorthand properties. */
1346
+ function typedSql(strings, ...values) {
1347
+ return new require_Expr.TemplateExpr(strings, values);
1348
+ }
1333
1349
  //#endregion
1334
1350
  exports.Ctx = Ctx;
1335
1351
  exports.SubqueryHandle = SubqueryHandle;