-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Flyway breaks when JDBC driver returns null URL #1909
Comments
This is actually implemented by SQLDroid: https://github.com/SQLDroid/SQLDroid/blob/master/src/main/java/org/sqldroid/SQLDroidDatabaseMetaData.java#L1002 So you are most likely running an outdated version. Either way, not a Flyway issue. |
If you checkout the github readme it states that the lastest version is 1.0.3. I think the whole project seems abandoned, and I don't think you should mention in (https://flywaydb.org/blog/flyway-3.0-android.html). I'll try to use the master branch but maybe you should create your own Android support? |
We have no plans to maintain the SQLDroid project. However consider talking to @jhannes as he has an active interest in this as well and has contributed various fixes to SQLDroid. Maybe the two of you could create and release an official fork. From our end, we'll happily recommend our users to use it instead of the now (seemingly) abandoned main SQLDroid repo. |
Had the same issue and am now using Flyway version 4.0.2 (I remembered this version from one (older?) documentation) instead of 5.0.3 in my Android project, and now it's working. I did not dig deeper into the problem and but maybe a workaround for you...
Did that help, by the way? @axelfontaine & team: Anyway, many many thanks for Flyway 👍 Bye, |
@victorroeder I downloaded the master branch and modified the code to make it work. I'm looking into using xerials jdbc library instead |
It's correct that the code is implemented now. However, I have not been able to convince the person with access to the Maven repository to release a new version of SQLDroid since then. :-/ |
I'm sorry, but I don't think that it is not a Flyway issue. You know getUrl() can return null, why you don't check it? Especially considering that you only need it for logging. |
@axelfontaine
What if there's a driver other than SQLDroid that returns a |
@lyubomyr-shaydariv Excellent point. We will support drivers returning |
@axelfontaine |
What version of Flyway are you using?
5.0.6
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Java API
What database are you using (type & version)?
Android Sqlite
What operating system are you using?
Android
What did you do?
(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
Flyway migrate
What did you expect to see?
What did you see instead?
SQLDroidDatabaseMetaData.getURL() is implemented
System.err.println(" ********************* not implemented @ "
+ DebugPrinter.getFileName() + " line "
+ DebugPrinter.getLineNumber());
return null;
resulting in
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.indexOf(java.lang.String)' on a null object reference
at org.flywaydb.core.internal.database.DatabaseFactory.filterUrl(DatabaseFactory.java:204)
at org.flywaydb.core.internal.database.DatabaseFactory.getJdbcUrl(DatabaseFactory.java:191
at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:72)
at org.flywaydb.core.Flyway.execute(Flyway.java:1629)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1168)
The text was updated successfully, but these errors were encountered: