-
Notifications
You must be signed in to change notification settings - Fork 656
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
DATE function not working #1627
Comments
I'm currently using alasql for semi-unit testing sql queries so I've only fixed it to the point that it works for us
the overrides also use |
Thanks for sharing. Do you remember why the build in function was not working for you? |
sure thing one simple example would be
in sql, these two should return as the same data type but it turns out the returned data types are different I thought since my team is using the library in a way that's different from it's intention (main purpose of this library seems to be for utilizing sql inside js without the behavior needing to match up against an actual sql engine, but we use this as a faster (despite being a bit less accurate) way of unit testing our sql queries ) these discrepancies are good-to-have's but not must-have's. Considering the nature of javascript, those two seemed understandable (just wrap them inside a Date object and they would pretty much be the same thing) |
I see. Yes. Hmm. This is a good point. This is not good. Ill see what I can do. |
Hey there, i'm interested in this issue will you please assign this to me. |
Sure! |
Any luck @Mohit269 ? |
Note
|
We will be introducing a breaking change where all date data are returned and formatted the same way @agershun and I have decided that we will default to the string format and provide an option get all raw date information as a javascript object. @Mohit269 Let me know if you are still keen on this or would like to step off this one. |
If the issue is still not fixed, I 'd like to contribute. @mathiasrw |
Do note that recently, the |
@paulrutter Thank you for pointing this out. I have updated https://github.com/AlaSQL/alasql/wiki/Alasql-Options @Shibn2 any progress on this? |
I want to work on this issue , if nobody is doing it |
@mathewalexKerala Please! |
@mathiasrw @mathewalexKerala can you please make sure that when using alasql.options.dateAsString=false, it remains to work as is? |
Its a good point. We should make sure to not change any of the old tests in order to get the new things working. |
sure |
@paulrutter @mathiasrw should I fix both the browser side and server side code ? |
That is the same code, as it's javascript either run in the browser or in nodejs. Thus, both environments will work if you have a fix for the issue at hand. |
the DATE function is not working as expected
in general, timestamp / date objects don't work as expected (we've overridden function slike NOW, DATE_ADD etc for this)
however
DATE
itself seems to not throw an error but overriding also doesn't work..I've tried overriding
DATE
for this but this throws a confusing error(consistent regardless of whether DATE is overriden before the DDL or after)
node version:
v14.17.3
alasql version:
2.5.3
The text was updated successfully, but these errors were encountered: