sql-adapter
sql-adapter copied to clipboard
database/sql Adapter for Casbin V2
Update table exist check sql to have better performance.
Add unique index for columns `(p_type,v0,v1,v2,v3,v4,v5)`. There is a limit in MySQL side for UNIQUE like `Error 1071 (42000): Specified key was too long; max key length is 3072 bytes`....
https://casbin.org/docs/management-api#addpoliciesex ``` AddPoliciesEx adds authorization rules to the current policy. If the rule already exists, the rule will not be added. But unlike AddPolicies, other non-existent rules are added instead...
I migrated my code to use `AddPolicy` in an effort to remediate https://github.com/Blank-Xu/sql-adapter/issues/10. I have a unique constraint on my casbin_rule table, and this method seems to handle that just...