Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle to H2/hsqldb etc adapter

I can't be the only person who has this problem so I am looking for suggestions.

We run our apps on Oracle but our integration tests use h2 for speedy in-memory testing, the database being built from DDL scripts at the start of testing.

The problem is that the use/syntax of some DDL commands differs between Oracle and h2/hsqldb. For example today I spent some time before I realised that 'grant select on ...' works on sequences in Oracle but only on tables in h2.

In a previous project we had an adapter to remove/translate such erroneous commands, which meant that our test database ran quite different code to that we implement to prod. While everything is very thoroughly acceptance tested it means that certain problems might not be spotted until quite late on in the dev cycle.

On my latest project I sense I am going down the same path - so surely others must also have trodden it.

Any suggestions? We're using java/maven so appropriate soutions welcome!

like image 750
Dave Richardson Avatar asked Nov 04 '22 17:11

Dave Richardson


1 Answers

There isn't such an adapter to my knowledge.

Anyway, I'd say that you're not going to achieve your goals with such an adapter. For one, the feature set of Oracle is not easily found in any other solution ( not that that's necessarily an advantage for Oracle).

like image 95
Robert Munteanu Avatar answered Nov 12 '22 20:11

Robert Munteanu