@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.
@@ -1094,6 +1094,9 @@ localDefinitionSchema.safeExtend({
1094
1094
  imports: zod.z.array(localDefinitionSchema).max(32).optional()
1095
1095
  });
1096
1096
 
1097
+ // src/client/sql.ts
1098
+ var BUILTIN_SQL_READ_HASH = "sha256:a50c477c952a5e0fe68ed158a4530e4aab573c09bcbb1a8ac454dc88a39a6258";
1099
+
1097
1100
  // src/ir/index.ts
1098
1101
  var LEGACY_IR_VERSION = 1;
1099
1102
  var GUARDED_IR_VERSION = 2;
@@ -1418,7 +1421,8 @@ var compiledOperationSchema = zod.z.object({
1418
1421
  }).superRefine((operation, ctx) => {
1419
1422
  if (operation.language === "sql") {
1420
1423
  const validPlan = operation.sqlQuery ? !operation.sql && operation.irVersion === RUNTIME_SQL_IR_VERSION : !!operation.sql && operation.irVersion === SQL_IR_VERSION;
1421
- if (!validPlan || operation.kind !== "query" || operation.roots.length !== 0 || !operation.requires?.capability) {
1424
+ const builtin = operation.name === "BuiltinSqlRead" && operation.opHash === BUILTIN_SQL_READ_HASH && operation.requires === null;
1425
+ if (!validPlan || operation.kind !== "query" || operation.roots.length !== 0 || !builtin && !operation.requires?.capability) {
1422
1426
  ctx.addIssue({ code: "custom", message: "SQL operations require a query-only v4 plan or v5 runtime contract, capability, and no GraphQL roots" });
1423
1427
  }
1424
1428
  } else if (operation.sql || operation.sqlQuery || operation.roots.length === 0) {