New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OrientDB support #947
Comments
+1 |
11 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 IMHO you would only need to make
Then you could add This way it would be a lot easier to support new databases and flyway core developers would not be a bottleneck to open it for new DBs. BTW: I am on my way to reimplement flyway from scratch for orientDB. However, this feels wrong to me. Help me stop reinventing the wheel. |
BTW: The advantage of rewriting flyway would be that it could be completely decoupled from JDBC and can also work for OrientDBs native java document API. However, if flyway would support it using JDBC for the migration would still be OK and one can still decide to use native java API after migration is performed... |
Another tricky part is that for some strange reason OrientDB does not support multiple SQL statements separated by semicolon (except in batch mode of console). To make flyway work with OrientDB it would also be necessary to tweak this. The easiest way would be to fix this in OrientDB SQL engine or in jdbc driver or orientDb. Otherwise if this has to be done without touching OrientDB one would have to also write a custom implementation of FlywayCallback that creates an instance of a custom implementation of JdbcTemplate that overrides all methods, tokenizes/parses the SQL to split into multiple statements and run them sequentially over JDBC. |
Hi @hohwille Actually OrientDB supports multiple SQL statements in Document API using OCommandScript
Please let me know if you need help on this! Thanks Luigi |
thanks @luigidellaquila for the feedback. That is good to know. But as Flyway ist completely wired to JDBC we would need this in the orient jdbc driver. According to my simple tests this fails, if I pass multiple semicolon separated statements to |
OK. I havent been using low-level JDBC for a while. It seems that it is not a task of JDBC to deal with multiple statements in a single SQL string: Then I have to dig deeper into flyway code and see where this is covered. From my first readings I got the impression that the entire SQL script is send to the JDBCTemplate. I might be wrong and missed something... |
Flyway parses a script into statements which are sent individually to the DB. |
What would it need to implement a plugin for OrientDB? We can provide a JavaCC grammar for CRUD statements (it partially covers also schema manipulation statements, it will be completed in short) Please let me know if I can help here Thanks Luigi |
Probably, to make things easier, it just makes sense to write a statement per row and split the script line by line. Just guessing... Luigi |
See my first comment: Source-Code to get startet can be found here: |
according to what @axelfontaine wrote, this seems to be already covered. Maybe flyway will also already strip comments from SQLs before sending over to JDBC. For that part besides comments, multiple statements, semicolon handling, EOL-styles, etc. that are to be covered by flyway it will just send the SQL as is via JDBC. So for that part no specific custom logic or SQL parser is required. You would simply write the SQLs in the native way for OrientDB and IMHO flyway would not bother about new syntax such as "TRAVERSE", "CREATE CLASS", "CREATE PROPERTY", etc. For DBSupport you only need to write a class that can create the metadata table and insert the records in there. That one should also be quite easy. |
+1 |
@hohwille I was wondering if you are still working on this. We have the need to do something similar and are looking home growing our own solution, but would rather not. |
+1 Has any work been done on this already? |
Any update on when Flyway 5.2.0 will be released? |
+1 |
Hi guys, go for it ASAP ! :). Your competition has already some unofficial OSS support and release ;-) |
+1 |
Please could you add support for OrientDB (http://www.orientechnologies.com/download/ - Community Edition).
The text was updated successfully, but these errors were encountered: