Skip to content

HQL Query Parsing via PEG Grammar #92#94

Draft
vnayar wants to merge 6 commits intobuggins:masterfrom
vnayar:feature/hql-peg-parsing
Draft

HQL Query Parsing via PEG Grammar #92#94
vnayar wants to merge 6 commits intobuggins:masterfrom
vnayar:feature/hql-peg-parsing

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