@sequenceholdings/orm 2.5.0 → 2.6.1

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/dist/ir.js CHANGED
@@ -1066,6 +1066,9 @@ localDefinitionSchema.safeExtend({
1066
1066
  imports: z.array(localDefinitionSchema).max(32).optional()
1067
1067
  });
1068
1068
 
1069
+ // src/client/sql.ts
1070
+ var BUILTIN_SQL_READ_HASH = "sha256:a50c477c952a5e0fe68ed158a4530e4aab573c09bcbb1a8ac454dc88a39a6258";
1071
+
1069
1072
  // src/ir/index.ts
1070
1073
  var IR_VERSION = 5;
1071
1074
  var LEGACY_IR_VERSION = 1;
@@ -1399,7 +1402,8 @@ var compiledOperationSchema = z.object({
1399
1402
  }).superRefine((operation, ctx) => {
1400
1403
  if (operation.language === "sql") {
1401
1404
  const validPlan = operation.sqlQuery ? !operation.sql && operation.irVersion === RUNTIME_SQL_IR_VERSION : !!operation.sql && operation.irVersion === SQL_IR_VERSION;
1402
- if (!validPlan || operation.kind !== "query" || operation.roots.length !== 0 || !operation.requires?.capability) {
1405
+ const builtin = operation.name === "BuiltinSqlRead" && operation.opHash === BUILTIN_SQL_READ_HASH && operation.requires === null;
1406
+ if (!validPlan || operation.kind !== "query" || operation.roots.length !== 0 || !builtin && !operation.requires?.capability) {
1403
1407
  ctx.addIssue({ code: "custom", message: "SQL operations require a query-only v4 plan or v5 runtime contract, capability, and no GraphQL roots" });
1404
1408
  }
1405
1409
  } else if (operation.sql || operation.sqlQuery || operation.roots.length === 0) {