Skip to content

Conversation

loubnaB023
Copy link

This PR fixes #1979 by extending the parser to recognize additional datetime functions and aliases.

Changes:

  1. Updated alasqlparser.jison:

    • Added lexer tokens for NOW, GETDATE, and CURRENT_TIMESTAMP
    • Enhanced PrimitiveValue and FuncValue to support:
      • CURRENT_TIMESTAMP with/without parentheses
      • NOW() and GETDATE() as valid functions
  2. Rebuilt the parser

  3. Added test/test-now.js to verify parsing of:

    • SELECT NOW()
    • SELECT GETDATE()
    • SELECT CURRENT_TIMESTAMP()
    • SELECT CURRENT_TIMESTAMP
    • SELECT CURRENT_DATE
    • SELECT CURDATE()
openSourcePassingTest

@mathiasrw
Copy link
Member

Nice. Very nice.

Please rename the test file to test1979.

Please make sure the test file will verify the output of each query that is now supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add GETDATE, NOW as alias to parser + allow CURRENT_TIMESTAMP with parenthesis
2 participants