shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Add Firebird support to testcontainers database type

Open TedCraft opened this issue 2 years ago • 7 comments

Feature Request

For English only, other languages will not be accepted.

Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot make decision by current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Is your feature request related to a problem?

Related to #33699.

Describe the feature you would like.

Firebird has support for testcontainers (https://github.com/FirebirdSQL/firebird-testcontainers-java), but I can't find this module in the official documentation (https://java.testcontainers.org/modules/databases/jdbc/).

We will investigate this issue later, maybe i will close this issue if the module is out of date or cannot be used in ShardingSphere.

TedCraft avatar Nov 24 '24 12:11 TedCraft

I tested the firebird-testcontainers library from this repository and found that it works with ODS versions up to 12.0, which corresponds to Firebird 3.0. However, it is incompatible with newer ODS versions, such as 13.1, used in Firebird 5.0, and produces the following error:

unsupported on-disk structure for file PATH TO DB; found 13.1, support 12.0;

This incompatibility arises because starting with Firebird 3.0, the ODS structure underwent significant changes, and Firebird 5.0 introduced a new ODS version (13.0).

Conclusion The firebird-testcontainers library functions only with ODS versions up to 12.0 (Firebird 3.0) but does not support newer versions like Firebird 5.0, which uses ODS 13.x. Therefore, integrating this library with ShardingSphere requires separate consideration, specifically whether we need support for newer versions of Firebird or if we can rely solely on version 3.0.


Additional Information

  • The article on qa.loginom.ru provides a detailed explanation of the issues related to ODS version incompatibility.
  • The Firebird FAQ - FAQ #80 offers instructions on extracting data from old databases and migrating it to newer Firebird versions. However, this approach does not address the core issue with the outdated library, which is limited to supporting ODS up to version 12.0.

makssent avatar Dec 07 '24 10:12 makssent

I think we also need to update the documentation at https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/optional-plugins/testcontainers/. Maybe reopen this issue or I can create a new one.

TedCraft avatar Dec 07 '24 14:12 TedCraft

Hi @TedCraft You can use Ref #33782 instead of Fixes #33782 next time, as it closes the issue by default.

strongduanmu avatar Dec 08 '24 23:12 strongduanmu

  • If you need to support a new version of Firebird, you only need to implement the SPI of https://github.com/testcontainers/testcontainers-java/blob/main/modules/jdbc/src/main/java/org/testcontainers/containers/JdbcDatabaseContainerProvider.java in the downstream project.

  • There are quite a few integration modules in testcontainers that only support old versions of databases, including clickhouse in https://github.com/testcontainers/testcontainers-java/issues/8736 and presto in https://github.com/testcontainers/testcontainers-java/issues/8657 . Most downstream users actually implement org.testcontainers.containers.JdbcDatabaseContainerProvider themselves.

  • Shardingsphere actually only requires that these jdbc:tc:xxx: prefixes have a corresponding OSS Maven module to facilitate further integration testing. I don't think it is necessary to try to wait for these Maven modules to update support for new versions of the database.

linghengqian avatar Dec 09 '24 06:12 linghengqian

At the moment, we are working on a major task, which is why we cannot fully delve into studying various issues that also concern us. Currently, I am just exploring the ShardingSphere project, looking for new features to add and implement, and gradually working on these topics. We hope to complete this task successfully by the New Year, and once it is accomplished, we will be able to fully focus on ShardingSphere. I will be able to finish everything I have planned, and your comment will be very helpful. Thank you for that!

makssent avatar Dec 09 '24 07:12 makssent

@strongduanmu I apologize, I made a mistake and used Ref instead of Fixes, which prevented the ticket from being closed automatically. Could you please close it? We will continue working on this topic in new issues.

makssent avatar Dec 09 '24 09:12 makssent

@makssent This was my mistake, I modified the Fixes, I close it now. 😂

strongduanmu avatar Dec 09 '24 09:12 strongduanmu