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
Apache Cayenne support #710
Comments
Came from here https://sourceforge.net/p/jailer/feature-requests/52/ |
Don't you mixing up here SQL and Velocity template constructs? Sorry for asking. |
I am, in a way. My idea was to quick-hack a way to analyse lots of (several megabytes) of SQL templates in that language. I thought a quick way would be to alter JSqlParser to just add few constructs to its grammar. But failed to fight my way trough https://javacc.org ideas. When token S_CHAR_LITERAL contains apostrophe and so does my feeble attempt -- see apostrophes in #result structure? Maybe that is not the quick way after all. Alternative: pre-process those SQL templates into SQL and only then apply JSQLParser. |
Cross-linking https://jira.apache.org/jira/browse/CAY-2495 |
The best way to tackle this, would be to accept three S_CHAR_LITERALs.
would be
I see no problem here. I do not know, where those constructs within a template SQL could be. The grammar adaption would be more difficult, I think, however not impossible. |
Nevertheless I would prefer the preprocess way, to not struggle with JSqlParser updates. I would replace all constructs to a parsable identifier form. Maybe
to
|
I'm also inclining that way, but I love grammar definition languages and wanted to investigate that approach as well. problem with S_CHAR_LITERAL is that it is NOT going to be handled properly later on. that #result(field type alias) is in effect and if I go with suggested <K_RESULT> grammar, I would never get that literal looked into by SelectItem part of grammar :( |
Closing this as stale. Feel welcome to re-open when this was still relevant. |
Friends, I'm fighting with lots of information in Apache Cayenne format.
It has SQL templated.
Tried to hack a bit its support.
Started with simple
struct from https://cayenne.apache.org/docs/3.0/scripting-sqltemplate.html
Would appreciate any suggestions as to how to work around the fact that S_CHAR_LITERAL token already has apostrophe inside it.
The text was updated successfully, but these errors were encountered: