Skip to content

Commit

Permalink
Fix AST coverage check error (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
zookatron authored Jul 31, 2024
1 parent d08fc7d commit ba67048
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/tests/select.queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,4 +390,10 @@ describe('Selections', () => {
rowCount: 2,
})
})

it('can select fully qualified column names', () => {
stuff();
expect(many(`SELECT "public"."test"."val" FROM "public"."test"`))
.to.deep.equal([{ val: 999 }, { val: 0 }, { val: 1 }, { val: 2 }, { val: 3 }]);
});
});
6 changes: 4 additions & 2 deletions src/transforms/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ export class Alias<T> extends TransformBase<T> implements _IAlias {
private _getColumn(column: string | ExprRef): IValue | nil {
if (typeof column !== 'string'
&& column.table) {
if (!column.table.schema
&& column.table.name !== this.name) {
if (column.table.schema && column.table.schema !== this.ownerSchema.name) {
return null;
}
if (column.table.name !== this.name) {
return null;
}
column = column.name;
Expand Down

0 comments on commit ba67048

Please sign in to comment.