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