Closed Meldiron closed 4 years ago
In my code I've always used string
for dates, because most of the time the input and output isn't a real Date
object.
Nevertheless, it should be possible to have it in your table definition. I updated the code and added some testcases.
Can you try v2.16.0?
Tried with 2.17, works perfectly.
Issue type:
[ ] Question [X] Bug report [ ] Feature request [ ] Documentation issue
Database system/driver:
[ ] Postgres [ ] MSSQL [X] MySQL [ ] MariaDB [ ] SQLite3 [ ] Oracle [ ] Amazon Redshift
typed-knex version:
[X]
latest
[ ]@next
[ ]0.x.x
(or put your version here)Description:
My code:
My definitions:
Error on line
.findByPrimaryKey(companyId, (r) => r.subscription);
, error is:Property 'subscription' does not exist on type 'TransformPropsToFunctionsOnlyLevel1<TableCompany>'.ts(2339)
I noticed that both subscription and createdAt are of type Date and both of them throws this typescript error. rest of properties are working fine (see screenshot).
Solution would be to use
.select()
and.where()
- this solution works perfectly with these Date-typed properties.