-
Notifications
You must be signed in to change notification settings - Fork 664
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
Add date function to get current date without time component #1937
Conversation
- Add CURDATE method to AlaSQL - Add test
- Support dateAsString option - Extend tests
- Add CURRENT_DATE alias - Extend test
@mathiasrw any feedback on this pr? Thanks! |
Interesting, relevant and missing. Nice.
looks good to me. I do feel like we should avoid none standard notation like Are you feeling the mojo to try to dive into that? Adding it to src/alasqlparser.jison should not be too complex, but I admit its a bit exotic if you have not worked with parsers before. |
Isn't the function exactly what MySQL offers? I do see that most also support an alias as constant, although we don't offer this for other date functions except CURRENT_TIMESTAMP in alasql. The current approach would be in line with other AlaSQL date functions. Do you want me to look into using these aliases? To the parser point, i'm not seeing the other date functions in there. Is that deliberate? Only CURRENT_TIMESTAMP is there, not NOW for example. I can look into adding it to the parser though next week. |
@mathiasrw I tried rebuilding the parser via I wouldn't expect changes against what's in git. I found #1903 (comment), will try that and update the package.json if that works. |
- Add rebuild parser documentation - Add CURDATE/CURRENT_DATE to parser definition - Allow both with and without parenthesis - Adjust test
@mathiasrw It feels to me like other date functions should be added to the parser as well, as these are currently missing. |
* #1936 Add date function to get current date without time component - Add CURDATE method to AlaSQL - Add test * #1936 Add date function to get current date without time component - Support dateAsString option - Extend tests * #1936 Add date function to get current date without time component - Add CURRENT_DATE alias - Extend test * - Fix running the parser in package.json - Add rebuild parser documentation - Add CURDATE/CURRENT_DATE to parser definition - Allow both with and without parenthesis - Adjust test * - Use tabs * - Use alias to prevent duplicate code for CURRENT_DATE * - Update dependencies
Thanks for merging, can we expect a new release soon? |
Released as part of v4.5.0 |
This removed the need for:
Thank you for the time you are putting into AlaSQL!