Closed rizky closed 3 years ago
"The decorator metadata feature is not meant to provide a full runtime type system, or a reflection-like feature." See https://github.com/microsoft/TypeScript/issues/9916
That's why you cannot use unions in your table definition classes.
Catching these errors and providing useful feedback has been challenging 😄
Because you will never select
and object like site
, you can either define it just as public site: TableSites;
or if you want public site?: TableSites;
BTW: To be able to move this library closer to Knex itself, the innerJoinColumn
and objects in table definition classes will probably need to be removed.
Got it! Thank you for your help and this amazing library with a lot of potential. Keep up the good work!
Issue type:
[x] Question [x] Bug report [ ] Feature request [ ] Documentation issue
Database system/driver:
[x] Postgres [ ] MSSQL [ ] MySQL [ ] MariaDB [ ] SQLite3 [ ] Oracle [ ] Amazon Redshift
typed-knex version:
[x]
latest
[ ]@next
[ ]0.x.x
(or put your version here)Table definition
Code
Error
It seems that reflect-metadata couldn't get design:type of propertyKey site, it returns undefined instead of TableSites. Did I configure Table definition correctly?
Using innerJoinTableOnFunction works perfectly fine.