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