Open tropcicstefan opened 3 years ago
I cannot say I don't agree on that one. I think it's a simple line to comment out if you don't want these Queries to be parsed. But, the intent is to make them work with any of our supported database. This is probably why we use a parser to create the equivalent "functions" for each of the RDBMS.
Though, it could be intentional that you just want to use a specific version of SQL Server and want to call some custom function that you made for it. So, yeah, this is limiting and probably can become counter productive at some point.
Please provide a PR 😉
Yes, and No.
The parsing is also required to provide the correct table prefixes for tenants, so if you just expose sql as sql, without any parsing, you open up a large can of worms.
Better to improve the parser with any missing functionality.
Plus also if you expose SQL directly, then I suspect this becomes possible.
DROP ...
Ok, I hear your reasoning for tenancy. Hypothetically could that be solved with liquid? If not improving parser it is :)
On second thought, I could just make custom query source for my usecase right?
Or simply from SQL Server use a different account for each tenants. But that would not secure things for SQLite though. And yes, for custom query source, I guess one SQL query source without parsing could work.
@tropcicstefan Take a look at this module https://github.com/EasyOC/EasyOC#%E6%95%B0%E6%8D%AE%E5%90%8C%E6%AD%A5
If the query you are trying to write can be done in all RDBMS then we can extend the grammar. If not then I think it's reasonable to add an option to not translate the query and use it as-is.
Obviously you can already write the query directly from code or custom modules, but I assume you are only interested in this feature in the context of the Queries feature.
Is your feature request related to a problem?
I have headless app and queries are pretty cool and easy solution for most of the app but current sql parser is somewhat limited. For instance you cannot combine 'distinct' and 'limit' because ordering isn't right after parsing. And I cannot do joins with lesser and greater signs. Plus why not provide developers with full ability of RDBMS.
Describe the solution you'd like
Maybe add checkbox in query create form to not parse query and visualize that a query is RDBMS specific in list of all queries.
Describe alternatives you've considered
Fix sql parser, but again why not give all functionalities of RDBMS.