-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
@tangyang9464 @imp2002 please review |
…tants file for database product names
1688c0d
to
49e2499
Compare
@@ -0,0 +1,9 @@ | |||
package org.casbin.constants; | |||
|
|||
public enum AdapterConstants { |
There was a problem hiding this comment.
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())) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Replaced by: #21 |
for #19 added unit test, added constants file for database product names