Skip to content

Add support for MariaDB database driver #836

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

Closed
Fezlight opened this issue Sep 22, 2024 · 4 comments
Closed

Add support for MariaDB database driver #836

Fezlight opened this issue Sep 22, 2024 · 4 comments
Assignees
Labels
in: event publication registry Event publication registry type: enhancement Major enhanvements, new features
Milestone

Comments

@Fezlight
Copy link
Contributor

Fezlight commented Sep 22, 2024

Do you have any information about support for MariaDB database through it's dedicated driver "org.mariadb.jdbc:mariadb-java-client" ?

Caused by: java.lang.IllegalArgumentException: Unsupported database type: MariaDB
   at org.springframework.modulith.events.jdbc.DatabaseType.lambda$from$1(DatabaseType.java:54)
   at java.base/java.util.Optional.orElseThrow(Optional.java:403)
   at org.springframework.modulith.events.jdbc.DatabaseType.from(DatabaseType.java:54)
   at org.springframework.modulith.events.jdbc.JdbcEventPublicationAutoConfiguration.databaseType(JdbcEventPublicationAutoConfiguration.java:45)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.base/java.lang.reflect.Method.invoke(Method.java:568)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:146)
   ... 85 common frames omitted

As an alternative, because MariaDB works like MySQL we can switch to the MySQL driver if version under 11.X but we loose some specific feature added by driver itself.

@odrotbohm odrotbohm added in: event publication registry Event publication registry type: enhancement Major enhanvements, new features meta: waiting for feedback Waiting for feedback of the original reporter labels Sep 23, 2024
@odrotbohm
Copy link
Member

We can, of course, add support for that. If you'd like to help, do you think could duplicate the MYSQL enum value in DatabaseType and create copies of the MySQL-related tests and schema files? Given the similar nature of Maria with MySQL, I don't think any further adjustments should be necessary.

@Fezlight
Copy link
Contributor Author

Fezlight commented Sep 23, 2024

Yes, I think duplicating the value of the enum is enough, as both work in the same way. I can do a PR when i got some time.

Fezlight added a commit to Fezlight/spring-modulith that referenced this issue Sep 23, 2024
@Fezlight
Copy link
Contributor Author

I finally opened the pull request :) #839

@odrotbohm
Copy link
Member

You apparently found time pretty quickly! 🙃 Merged, thanks!

@odrotbohm odrotbohm added this to the 1.3 RC1 milestone Sep 24, 2024
@odrotbohm odrotbohm self-assigned this Sep 24, 2024
@odrotbohm odrotbohm removed the meta: waiting for feedback Waiting for feedback of the original reporter label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: event publication registry Event publication registry type: enhancement Major enhanvements, new features
Projects
None yet
Development

No branches or pull requests

2 participants