Skip to content
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

Support for MariaDB #19

Open
happenedIn opened this issue Dec 31, 2024 · 3 comments
Open

Support for MariaDB #19

happenedIn opened this issue Dec 31, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@happenedIn
Copy link

Would like to add support for MariaDB datasources

@hsluoyz
Copy link
Member

hsluoyz commented Dec 31, 2024

@tangyang9464 @imp2002

@hsluoyz hsluoyz added the enhancement New feature or request label Dec 31, 2024
@hsluoyz hsluoyz self-assigned this Dec 31, 2024
happenedIn added a commit to happenedIn/hibernate-adapter that referenced this issue Dec 31, 2024
… constants file for database product names
@hsluoyz
Copy link
Member

hsluoyz commented Jan 1, 2025

@happenedIn does the existing code not work for MariaDB? Why add data source? MariaDB and MySQL should share the same API. We need a justification that we have to add MariaDB datasources, especially the datasources, what's datasources?

@happenedIn
Copy link
Author

@hsluoyz no because the existing code determines which database to perform operations using databaseProductName which is based off of the connection properties.

  1. If a driver along with credentials and database url is supplied to the constructor the databaseProductName is set if the driver string contains correct database type

  2. If a DataSource object is supplied to the constructor (which is what I'm using) the databaseProductName is determined from initSessionFactory() method line 160 this.databaseProductName = conn.getMetaData().getDatabaseProductName();. Since I'm connected to a MariaDB database that call returns MariaDB and this database string is not checked for in the createDatabase(), createTable(), or dropTable() methods.

I'm using a spring mvc application deployed in tomcat which uses a DataSource factory method. Something like this https://www.baeldung.com/spring-boot-configure-data-source-programmatic#configuring-a-datasource-bean

So I need to rely on the HibernateAdapter(Datasource datasource) constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants