sql-typechecker 0.0.59 → 0.0.61

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/out/cli.js CHANGED
@@ -242146,7 +242146,7 @@ function elabSelect(g, c, s) {
242146
242146
  fields: fr.type.fields.map((fi) => {
242147
242147
  const foundNullabilityInference = inferredNullability.find((inf) => eqQNames(inf.fromName, fr.name) && inf.fieldName === fi.name?.name);
242148
242148
  if (foundNullabilityInference && isNullable(fi.type)) {
242149
- const t = foundNullabilityInference.isNull === true ? BuiltinTypes.Null : unnullify(fi.type);
242149
+ const t = foundNullabilityInference.isNull === true ? fi.type : unnullify(fi.type);
242150
242150
  return {name: fi.name, type: t, _expr: fi._expr};
242151
242151
  } else {
242152
242152
  return fi;
@@ -242331,7 +242331,7 @@ function elabDeleteOrUpdate(g, c, s) {
242331
242331
  };
242332
242332
  if (s.where) {
242333
242333
  const whereT = elabExpr(g, newContext, s.where);
242334
- cast(g, s.where, whereT, BuiltinTypes.Boolean, "implicit");
242334
+ requireBoolean(s.where, whereT);
242335
242335
  }
242336
242336
  if (s.returning) {
242337
242337
  return {
@@ -242445,8 +242445,6 @@ function doCreateFunction(g, c, s) {
242445
242445
  if (s.returns && s.returns.type.kind === void 0 && s.returns.type.name === "record") {
242446
242446
  if (unifiedReturnType.kind !== "record") {
242447
242447
  throw new ErrorWithLocation(s._location, `Function should return record, but returns ${JSON.stringify(unifiedReturnType)}`);
242448
- } else if (unifiedReturnType.fields.length <= 1) {
242449
- throw new ErrorWithLocation(s._location, `Function should return more than one field when specified as RETURNS RECORD`);
242450
242448
  }
242451
242449
  }
242452
242450
  return {