timabell / sqlHawk

Database management / migration tooling. Java / JDBC based.
http://timabell.github.com/sqlHawk/
GNU General Public License v3.0
8 stars 4 forks source link

More reliable batch splitter #49

Open timabell opened 12 years ago

timabell commented 12 years ago

there is rudimentary support for splitting upgrade sql scripts into batches by the GO statement. This is prone to parsing errors as sqlHawk doesn't do full SQL parsing before splitting. See http://stackoverflow.com/questions/10734824/how-can-i-support-the-sql-go-statement-in-a-java-jtds-application and the resolved issue #41

Post version 0.6.1 scripts will be split only when GO is found on a line on its own, ignoring whitespace before and after, and case insensitive.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

timabell commented 12 years ago

Shelving this issue for now, the only thing that will trip the app up now is a GO on a line of its own that isn't supposed to be a batch split, or a GO inside /**/

To complete this issue it will need to do at the very least comment and quote parsing.

basp commented 10 years ago

The guys of the RoundhousE project (also a migration tool) seem to have a decently reliable SQL batch splitter going. Take a look at StatementSplitter.cs and some of the database classes (like SqlServerDatabase.cs for example). Hopefully it will help a bit make your splitter more robust. Good luck!

timabell commented 10 years ago

Thanks!