jcasbin / casbin-spring-boot-starter

Spring Boot 2.x & 3.x Starter for Casbin, see example at: https://github.com/jcasbin/casbin-spring-boot-example
https://mvnrepository.com/artifact/org.casbin/casbin-spring-boot-starter
Apache License 2.0
191 stars 70 forks source link

no ‘id’ in casbin rule? #21

Closed wy10cheng closed 3 years ago

wy10cheng commented 3 years ago

Coming from this issue: https://github.com/node-casbin/sequelize-adapter/issues/38

Hi,

Currently most of the casbin adapter casbin_rule table had added an ‘id’ column as the primary key. Could you please tell is it capable for this project to add back the ‘id’ column? Thanks a lot.

hsluoyz commented 3 years ago

@wy10cheng can you provide the reproduce example and the crash log?

hsluoyz commented 3 years ago

@shy1st please take a look.

/cc @fangzhengjin

Moon-86 commented 3 years ago

@wy10cheng can you provide the reproduce example and the crash log?

fontend use node-casbin/sequelize-adapter backend use jcasbin/casbin-spring-boot-starter because table casbin_rule no id column in casbin-spring-boot-starter, exception throw

"2021-01-22 14:14:20.986 INFO 5143 --- [nio-8080-exec-1] org.casbin.jcasbin : An exception occurred:PreparedStatementCallback; bad SQL grammar [INSERT INTO casbin_rule VALUES(?, ?, ?, ?, ?, ?, ?)]; nested exception is java.sql.SQLException: Column count doesn't match value count at row 1"

shy1st commented 3 years ago

@wy10cheng I think it is ok that when we create the table rule, it will generate auto increment primary key.I will make up for that.

hsluoyz commented 3 years ago

@wy10cheng release v0.0.11: https://github.com/jcasbin/casbin-spring-boot-starter/releases/tag/0.0.11