Open mountainash opened 1 year ago
drizzle-orm
0.27.2
drizzle-kit
No response
Filtering gt, lt or between on dates [with SQLite] doesn't return expected results.
gt
lt
between
I've created an isolated example to show (and play with this) at https://codesandbox.io/p/sandbox/drizzle-dates-d4yqmk
See the README.md for instructions on seeding and running. See index.ts for the script and to uncomment the various where conditions.
README.md
where
.where(gt(transactions.date, new Date("2015"))) returns
.where(gt(transactions.date, new Date("2015")))
[ { "date": 2015-11-19T19:23:26.000Z, "price": 1 }, { "date": 2016-07-19T02:48:39.000Z, "price": 991 }, { "date": 2013-02-25T19:40:01.000Z, "price": 696 }, { "date": 2017-10-01T13:57:38.000Z, "price": 186 }, { "date": 2011-06-16T17:09:13.000Z, "price": 173 } ]
Expect the row returned to match the where condition when used with a Date.
Date
From the example above, I'd expect the results to be limited to:
[ { "date": 2016-07-19T02:48:39.000Z, "price": 991 }, { "date": 2017-10-01T13:57:38.000Z, "price": 186 } ]
still not fixed?
What version of
drizzle-orm
are you using?0.27.2
What version of
drizzle-kit
are you using?No response
Describe the Bug
Filtering
gt
,lt
orbetween
on dates [with SQLite] doesn't return expected results.I've created an isolated example to show (and play with this) at https://codesandbox.io/p/sandbox/drizzle-dates-d4yqmk
See the
README.md
for instructions on seeding and running. See index.ts for the script and to uncomment the variouswhere
conditions..where(gt(transactions.date, new Date("2015")))
returnsExpected behavior
Expect the row returned to match the
where
condition when used with aDate
.From the example above, I'd expect the results to be limited to:
Environment & setup