Skip to content

feat: add support for mariadb datasource, #20

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

Conversation

happenedIn
Copy link
Contributor

@happenedIn happenedIn commented Dec 31, 2024

for #19 added unit test, added constants file for database product names

@hsluoyz
Copy link
Member

hsluoyz commented Dec 31, 2024

@tangyang9464 @imp2002 please review

@CLAassistant
Copy link

CLAassistant commented Dec 31, 2024

CLA assistant check
All committers have signed the CLA.

@happenedIn happenedIn changed the title #19 add support for mariadb datasource, feat: add support for mariadb datasource, Dec 31, 2024
@happenedIn happenedIn force-pushed the support-mariadb-datasource branch from 1688c0d to 49e2499 Compare December 31, 2024 07:43
@@ -0,0 +1,9 @@
package org.casbin.constants;

public enum AdapterConstants {
Copy link
Member

Choose a reason for hiding this comment

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

This code is too tedius

@@ -59,10 +60,10 @@ private void open() throws SQLException {
private void createDatabase() {
Session session = factory.openSession();
Transaction tx = session.beginTransaction();
if (this.databaseProductName.contains("MySQL")) {
if (this.databaseProductName.contains(AdapterConstants.MySQL.name()) || this.databaseProductName.contains(AdapterConstants.MariaDB.name())) {
Copy link
Member

Choose a reason for hiding this comment

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

Don't repeat this thing so many times. Make it simpler and smaller

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, added a new PR that is simpler

@hsluoyz
Copy link
Member

hsluoyz commented Dec 31, 2024

Replaced by: #21

@hsluoyz hsluoyz closed this Dec 31, 2024
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