Closed cyjaysong closed 4 years ago
@nodece @GopherJ @dovics @divy9881 please review.
@CyJaySong please add the NewAdapterWithTableName
method.
When you call the NewAdapter
, casbin table has been created.
I don't like to use Adapter as the field of casbinRule, It looks really strange. Perhaps a global variable would be better, what do you think @CyJaySong @hsluoyz @nodece
ok great, @CyJaySong please add a global method named is SetTableName
for set table name.
I don't like to use Adapter as the field of casbinRule, It looks really strange. Perhaps a global variable would be better, what do you think @CyJaySong @hsluoyz @nodece
I agree. It's really weird to have adapter there.
@CyJaySong can you make changes based on review comments?
I was negligent. I will modify it
Zixuan Liu notifications@github.com 于2020年7月9日周四 下午10:35写道:
When you call the NewAdapter, casbin table has been created.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/casbin/xorm-adapter/pull/30#issuecomment-656165472, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAB2LY3MAC5VZK2MFYAZOTR2XIUTANCNFSM4OVNXKMQ .
It is not appropriate to use global variables。There is a problem using more than one xorm adapter
dovics notifications@github.com 于2020年7月9日周四 下午10:53写道:
I don't like to use Adapter as the field of casbinRule, It looks really strange. Perhaps a global variable would be better, what do you think @CyJaySong https://github.com/CyJaySong @hsluoyz https://github.com/hsluoyz @nodece https://github.com/nodece
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/casbin/xorm-adapter/pull/30#issuecomment-656175971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHAB2L44K7MN32IONPZATADR2XKYHANCNFSM4OVNXKMQ .
@CyJaySong Could you add tests for the feature?
@CyJaySong Could you add tests for the feature?
Is there anything wrong with that?
Looks good, but we also need to write test case to test the feature.
Looks good, but we also need to write test case to test the feature.
I have no inspiration
tableName
should not be put into Casbin rule. I think the code quality of this PR is not ideal. Sorry that I have to close it. Feel free to raise a new good one.
Hi @hsluoyz , The tableName
will not be added to DB, due to we add xorm: "-"
to struct tag, so the implementation is correct.
We can't define a global variable for set table name.
It is not appropriate to use global variables。There is a problem using more than one xorm adapter
OK. Go ahead!
OK. Go ahead!
So, do you agree to merge 😅
OK. Go ahead!
So, do you agree to merge 😅
@nodece can decide.
@hsluoyz Could you give me the repository permission?
OK. Granted.
Add custom tablename support