Skip to content
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

HQL Query Parsing via PEG Grammar #92 #94

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

vnayar
Copy link
Contributor

@vnayar vnayar commented Jun 16, 2024

This is a draft PR which is not yet complete, but due to the amount of work remaining, I thought it would be a good idea to share some of the early progress.

There is a new module added as hibernated.hql, and this module contains only the logic to parse HQL queries, which will serve as a the basis to support a much larger set of features than just FROM ... WHERE ... HQL queries. Furthermore, when properly integrated, PEG parsers can give users far more precise feedback in terms of syntax errors.

Running dub test currently prints out what a parsed query looks like, which can be used later for interpretation.

This work relates to the desire to add more HQL features, such as bulk insert/update/delete mentioned in Issue #92.

eoi <- !.
`));

/// A sanity check on the HQL select clause.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SingingBush So far so good with the parsing, right?

If I continue work to integrate it into the HQL query processing logic in query.d, it should be ok, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry for the delay in responding. I think if this is merged you will be the primary user that is going to battle test it so I think it's worth keeping as a branch until it's put through it's paces a bit.

I am weary of needing a dependency on pegged by default so I think it worth having hql support either being a configuration that can be added during the build with something like:

    "configurations": [
        ...
        {
            "name": "hql",
            "dependencies": {
                "ddbc": "~>0.6.0",
                "pegged": "~>0.4.9"
            }
        }
    ]

or having it be it's own sub-project. Then the feature can be something that users choose to opt-in to.

As mentioned before this isn't my repository so having some feed back from buggins or other users would be helpful. Especially as I'm not currently using D for anything critical at the minute.

That said, if integration tests cover the hql feature adequately and everything works as expected then I'm happy to merge it.

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.

2 participants