use dbgate-query-splitter lib to split queries#119
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Change SummaryThe PR replaces a custom 67-line SQL query splitter with a call to the Benefits of this change:
Note: The current implementation uses PostgreSQL-specific options for all database types. The PR author acknowledges this limitation and notes that passing the database type to select appropriate splitter options would be a future enhancement. Reviewed by kimi-k2.5 · 98,891 tokens |
|
Hi! |
|
i don't know how external drivers are managed but anyway the current solution still handle all old cases with extra support for postgres syntax (i set the options of in fact i use what do you think:
My Best Regards :) |
The Issue
the function
splitQueriesworks for normal SQL likeSELECT,UPDATE, ...etc. But, when it comes to SQL like creating a function or stored procedure it fails to split properly like the following example:The Fix
inside
splitQueriesfunction inutilsmodule callsplitQueryfunction fromdbgate-query-splitterlibrary to handle the splitting.Issues That Still Exist
Due to slight difference in syntax between DBMS
SplitQueryfunction accespts an optional second parameter which isSplitterOptions. each DBMS has own unique options that make splitting differs.To solve we need to pass the database name to the
splitQueriesfunction so the we can determine which options to pass tosplitQueryfunction. Unfortunately, I can only work withVue,Svelte, orTypeScript, notReact, and because this solution requires modifying code within React files, I couldn't implement it :(