You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The array will have the same struct passed into it at one time and is expected to apply to the same table for each object in it. There are many different caches though which is why I am using an interface rather than a concrete type. I tried to use db.Model passing the struct and also the db.Table passing the table name but it received a panic in gorm's code.
GormDAO is an implementation of an orm interface that uses Gorm.
It should be generic, so we don't know the type until the runtime.
How can I set the table name using Gorm?
The document you expected this should be explained
I didn't find any documentation explaining how to use interface with Gorm.
Expected answer
Documentation about how to use interfaces with Gorm.
The text was updated successfully, but these errors were encountered:
Your Question
I'm trying to pass an slice of interface to the Create method but it returns an error:
The CacheType is an interface defined as follow:
The array will have the same struct passed into it at one time and is expected to apply to the same table for each object in it. There are many different caches though which is why I am using an interface rather than a concrete type. I tried to use
db.Model
passing the struct and also thedb.Table
passing the table name but it received a panic in gorm's code.GormDAO is an implementation of an orm interface that uses Gorm.
It should be generic, so we don't know the type until the runtime.
How can I set the table name using Gorm?
The document you expected this should be explained
I didn't find any documentation explaining how to use interface with Gorm.
Expected answer
Documentation about how to use interfaces with Gorm.
The text was updated successfully, but these errors were encountered: