Possible to filter SQL statements before execution?

22 views
Skip to first unread message

Boris Granveaud

unread,
Jul 30, 2012, 6:07:24 AM7/30/12
to h2-da...@googlegroups.com
Hello,

Is there a mean to set a filter class to transform SQL statements on-the-fly before execution?

I'm using MySQL as a main DB and H2 for unit tests and I'm stuck by SQL compatibility problems. My idea is to replace for example DROP TEMPORARY TABLE by DROP TABLE, or CREATE TABLE (...) ENGINE=MEMORY by CREATE TABLE (...)

Thanks,
Boris.

Thomas Mueller

unread,
Aug 6, 2012, 2:42:53 AM8/6/12
to h2-da...@googlegroups.com
Hi,

You would have to filter within your own code. It might be simpler if you patch H2 to support the MySQL syntax. The parser (Parser.java) should be relatively easy to extend. I can't promise this will be included in H2, but patches are always welcome, specially patches that improve compatibility.

Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/QfFY4vFQUbEJ.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
Reply all
Reply to author
Forward
0 new messages