Skip to content
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

Using NewAdapter will reset all tables already registered in default #28

Open
YuPengZhangL opened this issue Jan 26, 2024 · 0 comments
Open
Assignees
Labels

Comments

@YuPengZhangL
Copy link

YuPengZhangL commented Jan 26, 2024

Problematic code:

func (a *Adapter) registerModel() {
	one.Do(func() {
		orm.ResetModelCache()
		orm.RegisterModel(&CasbinRule{tableName: a.tableName, tablePrefix: a.tablePrefix})
	})
}

Phenomenon:
orm.ResetModelCache() will clear all the existing default table structures registered in the ORM. Hope to improve this."

@hsluoyz hsluoyz changed the title 使用NewAdapter会reset掉default已经注册的所有表 Using NewAdapter will reset all tables already registered in default Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants