You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line is where the key for the given field is modified to apply JSON-lookup syntax.
Stack trace
This is misleading, just demonstrates what happens. The entity below has two @Propertys, one of which is dataHash(a string type), and the other as internalData(a JSON type).
error: select "e0".* from "datapoints" as "e0" where "e0"."data_hash" = 'lol' and "internalData"->>'title' = NULL - column "internalData" does not exist
at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:357:11)
at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:186:21)
at Parser.parse (node_modules/pg-protocol/src/parser.ts:101:30)
at Socket.stream.on (node_modules/pg-protocol/src/index.ts:7:48)
To Reproduce
Steps to reproduce the behavior:
Create an entity in a Postgres-backed Mikro-ORM project with a JSON property and a different property name than the column it points at. Easiest way to do this is: @Property({type: 'json'}) aField: Record<string, any> = {}
Insert some data into that field in the DB.
Run a query, any query(where, select, sort, etc) on a property in that field. I have an example above.
Expected behavior
The query to target the appropriate column.
Additional context
None
Versions
Dependency
Version
node
10
typescript
4.2
mikro-orm
4.4.4
pg
8.3.2
The text was updated successfully, but these errors were encountered:
Also as a sidenote, it's possible this is also causing the bug for why JSON-queries that filter for null come out as = null instead of is null(as the former will always return empty).
Describe the bug
The title really says it all.
Some extra detail, to aid in fixing:
Stack trace
This is misleading, just demonstrates what happens. The entity below has two
@Property
s, one of which isdataHash
(a string type), and the other asinternalData
(a JSON type).To Reproduce
Steps to reproduce the behavior:
@Property({type: 'json'}) aField: Record<string, any> = {}
Expected behavior
The query to target the appropriate column.
Additional context
None
Versions
The text was updated successfully, but these errors were encountered: