b49b216b362bc0ddad981fe912ca2829f007f864
Resolves a query compilation bug in JSPG where reverse/incoming polymorphic
edges (where edge.forward == false, e.g. pet ➡️ cover_attachment) mistakenly
appended the destination type constraint to the parent query's WHERE clause
(e.g., producing `entity_1.type = 'attachment'` on a pet entity query,
causing it to match 0 rows and return null).
- Modifies `compile_polymorphic_bounds` in `compiler.rs` to only compile
type checks when `edge.forward` is true. For reverse edges, the parent's
type check does not belong on the parent table and is already implicitly
restricted by parent ID joins.
- Updates the `fk_attachment_attachable_entity` relation in the queryer test
fixture to correctly model a two-column polymorphic relation, ensuring
this code path is exercised by the unit test suite.
JSPG - JSON Schema Validation for PostgreSQL
Description
Languages
Rust
99.2%
Shell
0.8%