-
Notifications
You must be signed in to change notification settings - Fork 41
QuestDB support #87
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
QuestDB support #87
Conversation
|
Hi! |
|
Hi @piers-williams, @WilliamL-RG, @alistair-RG! Please, let me know if I can help the review process in any way. |
|
Hey @piers-williams, @WilliamL-RG, @alistair-RG , We have some Flyway users who need this plugin, and we are happy to turn things around quickly if there are any issues with the PR. Please could you let us know what is needed, and if you have any idea of a rough ETA, if you are happy to accept it? Thank you! |
| } | ||
|
|
||
| @Override | ||
| public boolean handlesDatabaseProductNameAndVersion(String databaseProductName, String databaseProductVersion, Connection connection) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At present, this will conflict with the standard Postgresql database implementation. Is there anything that can be done to differentiate QuestDB from Postgresql? If there is, then also please override getPriority and return 1 to check QuestDB before Postgresql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QuestDB implements the Postgres Wire Protocol, and does not have its own driver.
The driver's metadata will always say that it is a Postgres connection, databaseProductName will be always PostgreSQL.
See https://github.com/pgjdbc/pgjdbc/blob/7b1984b25590171906c96687bc99d7aeaa7a8000/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L162
databaseProductVersion does not help either, because QuestDB returns with the Postgres server version it is compatible with.
It is impossible to distinguish between a Postgres and a QuestDB connection without talking to the server.
I will use the connection to query for the catalog version of the server, if that is ok.
That should return with something like:
PostgreSQL 12.3, compiled by Visual C++ build 1914, 64-bit, QuestDB"
This will tell if the server is a QuestDB instance or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change implemented in dd1aef2
piers-williams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks - one last set of changes to use FlywayException and I think this will be good to go!
...abase-questdb/src/main/java/org/flywaydb/community/database/questdb/QuestDBDatabaseType.java
Outdated
Show resolved
Hide resolved
...abase-questdb/src/main/java/org/flywaydb/community/database/questdb/QuestDBDatabaseType.java
Outdated
Show resolved
Hide resolved
...abase-questdb/src/main/java/org/flywaydb/community/database/questdb/QuestDBDatabaseType.java
Show resolved
Hide resolved
…atabase/questdb/QuestDBDatabaseType.java Co-authored-by: Piers Williams <[email protected]>
…atabase/questdb/QuestDBDatabaseType.java Co-authored-by: Piers Williams <[email protected]>
…atabase/questdb/QuestDBDatabaseType.java Co-authored-by: Piers Williams <[email protected]>
Accepted the commit suggestions. |
|
Thank you for merging the PR, @piers-williams ! Noticed this error during build: I wonder if you need to migrate to the new maven release plugin. |
QuestDB support.
Test class uses
testcontainers(https://java.testcontainers.org/) which requires docker.