@dbsp/nql 1.8.1 → 1.9.0

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/index.d.ts CHANGED
@@ -532,8 +532,8 @@ declare class NqlCompiler {
532
532
  * binding. #213 B2: detection consumes `ctx.lastMutationReturningItems`
533
533
  * (alias-aware, positional) — NEVER the collapsed `columns` names — so an
534
534
  * alias colliding with a real column (`returning email as name`) is
535
- * flagged 'aliased-returning' rather than silently mistyped as the
536
- * colliding column's type.
535
+ * typed by its physical source column rather than silently mistyped as the
536
+ * colliding output column's type.
537
537
  */
538
538
  private buildMutationReturningColumnTypes;
539
539
  private compileSingleStatement;
package/dist/index.js CHANGED
@@ -4866,8 +4866,8 @@ var NqlCompiler = class {
4866
4866
  * binding. #213 B2: detection consumes `ctx.lastMutationReturningItems`
4867
4867
  * (alias-aware, positional) — NEVER the collapsed `columns` names — so an
4868
4868
  * alias colliding with a real column (`returning email as name`) is
4869
- * flagged 'aliased-returning' rather than silently mistyped as the
4870
- * colliding column's type.
4869
+ * typed by its physical source column rather than silently mistyped as the
4870
+ * colliding output column's type.
4871
4871
  */
4872
4872
  buildMutationReturningColumnTypes(table, columns) {
4873
4873
  const items = this.ctx.lastMutationReturningItems;
@@ -4875,7 +4875,11 @@ var NqlCompiler = class {
4875
4875
  (column, index) => {
4876
4876
  const item = items !== void 0 && items !== "star" ? items[index] : void 0;
4877
4877
  if (item?.aliased) {
4878
- return { column, untypeable: "aliased-returning" };
4878
+ const typeInfo2 = this.ctx.validator?.getTableColumnType(
4879
+ table,
4880
+ item.source
4881
+ );
4882
+ return typeInfo2 !== void 0 ? { column, typed: typeInfo2 } : { column, untypeable: "unresolvable-source" };
4879
4883
  }
4880
4884
  const typeInfo = this.ctx.validator?.getTableColumnType(table, column);
4881
4885
  return typeInfo !== void 0 ? { column, typed: typeInfo } : { column, untypeable: "unresolvable-source" };