Open igo opened 6 years ago
@igo Date
's should be supported out of the box. You might face this problem however:
https://stackoverflow.com/questions/41916012/storing-a-node-js-date-in-a-knex-datetime-mysql-datetime-field/41941071
Check the answer on this question and if it doesn't help, please provide exact reproduction steps for your issue.
@igo What I do in this case is use typeCast
to covert date to what I need.
Here is an example: https://stackoverflow.com/questions/45103788/knexjs-returning-mysql-timestamp-datetime-columns-as-javascript-date-object
@mitjade yep, that's my problem. I found that solution as well but this unfortunately works only for MySQL. since this is MySQL driver feature. We need solution that works for other DBs as well.
Date fields cannot be used out of box. sqlite (and eventualy other databases) stores date as integer and no conversion to Date is done out of box when performing
SELECT
. Could you please add support or update examples how to use date fields?