We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given this model:
entity Bar { key ID : Integer; baz : Association to Baz; hurz : Association to Hurz; } entity Baz { key ID : Integer; } entity Hurz { key ID : Integer; }
the where clause of the exists subquery is broken:
> q = SELECT.from('Bar[baz = 1 and baz = ID]:hurz') Query { SELECT: { from: { ref: [ { id: 'Bar', where: [ { ref: [ 'baz' ] }, '=', { val: 1 }, 'and', { ref: [ 'baz' ] }, '=', { ref: [ 'ID' ] } ] }, 'hurz' ] } } } > q.forSQL() Query { SELECT: { from: { ref: [ 'Hurz' ], as: 'hurz' }, where: [ 'exists', { SELECT: { from: { ref: [ 'Bar' ], as: 'Bar' }, columns: [ { val: 1 } ], where: [ { ref: [ 'Bar', 'hurz_ID' ] }, '=', { ref: [ 'hurz', 'ID' ] }, 'and', { xpr: [ { ref: [ 'Bar', 'baz_ID' ] }, '=', { val: 1 } ] }, 'and', // ❌❌❌❌ '=', { ref: [ 'Bar', 'ID' ] } ] } } ], columns: [ { ref: [ 'hurz', 'ID' ] } ] } }
also broken in a different way if the condition is flipped:
> q = SELECT.from('Bar[baz = 1 and ID = baz]:hurz') Query { SELECT: { from: { ref: [ { id: 'Bar', where: [ { ref: [ 'baz' ] }, '=', { val: 1 }, 'and', { ref: [ 'ID' ] }, '=', { ref: [ 'baz' ] } ] }, 'hurz' ] } } } > q.forSQL() Query { SELECT: { from: { ref: [ 'Hurz' ], as: 'hurz' }, where: [ 'exists', { SELECT: { from: { ref: [ 'Bar' ], as: 'Bar' }, columns: [ { val: 1 } ], where: [ { ref: [ 'Bar', 'hurz_ID' ] }, '=', { ref: [ 'hurz', 'ID' ] }, 'and', { xpr: [ { ref: [ 'Bar', 'baz_ID' ] }, '=', { val: 1 } ] }, 'and', { ref: [ 'Bar', 'ID' ] }, '=', { ref: [ 'Bar', 'baz' ] } // ❌❌❌❌ ] } } ], columns: [ { ref: [ 'hurz', 'ID' ] } ] } }
The text was updated successfully, but these errors were encountered:
patricebender
No branches or pull requests
Given this model:
the where clause of the exists subquery is broken:
also broken in a different way if the condition is flipped:
The text was updated successfully, but these errors were encountered: