Mirage is a simple SQL centric database access library. See the following URL to know about Mirage:
New features in Mirage 1.1.3:
- Added SchemaUpdater and SchemaUpdateListener to update database schema automatically.
- Added Session#setRollbackOnly() and Session#isRollbackOnly() to rollback transaction without exception.
- SQL parsing result caching for performance improvement. You can control cache mode via SqlManagerImpl#setCacheMode().
- Oracle hint support in 2-way SQL
- Added ResultEntityCreator interface to extends SqlManager.
- Added PropertyExtractor interface to extends BeanDesc.
- Scala wrapper named mirage-scala is available.
This release contains the first release of mirage-scala. This is a wrapper of Mirage for Scala.
I have tested so many features and patterns in mirage-scala. However I couldn't believe how interface is best for mirage-scala. So I decided to release with minimum features in the first release. mirage-scala has not enough features now, however it will be expanded in the future.
I hope Mirage helps your development. Enjoy!
5 件のコメント:
Thank you very much for the release, but the SQL parser still seems to have problems with the Oracle syntax:
Combination with 'sysdate' as parameter aren't recognized correctly. E.g. following selects are parsed wrongly:
select * from user where to_date > /*to_date*/sysdate;
is replaced correctly, but when using other combinations, e.g. "sysdate - 1" or something else, the replacement replaces only the beginning "sysdate" with an ?.
A much better approach would be to allow/enforce the use of parentheses, e.g:
select * from user where column > /*param*/(expression);
In this case, the entire expression would be replaced with an '?'.
Thank you.
Mirage replaces only one word after the parameter.
So you can't place an expression which contains white space after the parameter.
Mirage replaces only one word after the parameter.
It would be nice however if Mirage would support an expression too, i.e. everything that is enclosed in parentheses:
select * from user where column > /*param*/(expression);
I tried to modify the SQL Parser to do this, but unfortunately this is not very easy since there's no grammar definition file :(.
Also would be nice if prepareNode() and prepareSqlContext() would be public.
Thank you.
Also it would be very nice if Mirage(the SQL parser) could "chop" the semicolon (if there's any) from the end of a SQL. This would make Mirage even more tool friendly since many tools let semicolons at the end of SQLs, but Java can't handle them if given for a prepared statement.
Thanks for your feedback!
Chopping semicolon which is at the end of the SQL file would be possible. It will be available in the next release.
コメントを投稿