Skip to content

Conversation

@glasstiger
Copy link
Contributor

QuestDB support.

Test class uses testcontainers (https://java.testcontainers.org/) which requires docker.

@glasstiger
Copy link
Contributor Author

glasstiger commented May 14, 2025

Hi!
This PR adds support for QuestDB, and would really appreciate any feedback on the code changes.
If you have few minutes to spare, please, take a look.
Thank you in advance for your time!

@glasstiger
Copy link
Contributor Author

Hi @piers-williams, @WilliamL-RG, @alistair-RG!
Do you, guys, have an idea when you can take a look at the PR?

Please, let me know if I can help the review process in any way.
By creating a repo with a demo project, for example?

@nwoolmer
Copy link

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change implemented in dd1aef2

Copy link
Contributor

@piers-williams piers-williams left a 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!

glasstiger and others added 3 commits July 9, 2025 13:59
…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]>
@glasstiger
Copy link
Contributor Author

Awesome thanks - one last set of changes to use FlywayException and I think this will be good to go!

Accepted the commit suggestions.
Thank you.

@piers-williams piers-williams merged commit aa51bf7 into flyway:main Jul 10, 2025
1 check passed
@glasstiger
Copy link
Contributor Author

Thank you for merging the PR, @piers-williams !

Noticed this error during build:
https://github.com/flyway/flyway-community-db-support/actions/runs/16195516962/job/45720906344

I wonder if you need to migrate to the new maven release plugin.
We had to make these changes in our project recently to be able to release:
https://github.com/questdb/questdb/pull/5901/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants