New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datetime bug in query builder #3461
Comments
Yep, looks like a bug. Knex should not change Date() to string. https://runkit.com/embed/ai9im80r6iin Parameter should be left untouched by knex and passed as Date object to the driver. |
@elhigu When querying an Oracle database the parameter value becomes |
FYI after more debugging, i think its related to something babel is doing in transpiling... may be doing something that breaks detection of |
@Fylipp I was able to get around it by doing: await knex("Entry").count("*").where("createdAt", ">", (new Date(nowAt - oneMinute)).toISOString()) |
@chaffeqa Yep... I never have used date object in bindings either. I always pass dates as iso strings.
Doesn't seem like null to me... https://runkit.com/embed/nbtrv0kj944a This is not a priority to fix, but pull requests are welcome as usual. |
Environment
Knex version: 0.18.3
Database + version: mysql Ver 8.0.15 for osx10.14 on x86_64 (Homebrew)
OS: osx10.14
Bug
Simple query involving
Date
object seems to fail to pass compilation, thoughtoString()
generates valid SQLThe text was updated successfully, but these errors were encountered: