error: select structured_address->>neighbourhood from "bulletinsf2e5f6bd6f371db3f0fc12b482bbac7f" group by structured_address->>"neighbourhood" limit $1 - column "neighbourhood" does not exist
they build SQL queries for you
objectionjs doesn't build any queries for you if you don't want to. It uses knex for building queries. Only if you specially choose to ask for related data it will build needed joins / multiple queries automatically (many times doing multiple queries instead of joins is more performant).
you can just extract it and name it whatever you want and use it multiple time
Then it is pretty much like relation declaration.
, but that's just creating select they cannot create query for you and I don't think that I will I'm happy to build my queries.
That return type declaration is tightly coupled with the query which for it was created... so you actually need store both somewhere for effectively reuse the type... so... it sounds like manually done one-off relation declaration with possibly some filtering (supporting only reading data, for example inserting nested data would't work)..
.whereRaw('date+time >= ? AND date+time <= ?', [from, to])