Documentation
¶
Index ¶
- Variables
- func CustomViewName(db *gorm.DB, obj any, name string) string
- func DefaultTableName(db *gorm.DB, obj any, appendStr string) string
- func DefaultViewName(db *gorm.DB, obj any, version int) string
- func NewViewsPlugin(models []interface{}) *viewsPlugin
- func TableOrViewName(db *gorm.DB, obj ViewModel, appendStr string) string
- type ViewModel
Constants ¶
This section is empty.
Variables ¶
View Source
var DisableViewsKey string = "disable_views_key"
Functions ¶
func DefaultTableName ¶
DefaultTableName returns the default table name for an object, appending the provided string. This should be used when scopes.WithDisableViews is applied to the query.
func NewViewsPlugin ¶
func NewViewsPlugin(models []interface{}) *viewsPlugin
ViewsPlugin is a plugin that enables turning on a view for specific models. This will overwrite the table name on query/preload to add the _view suffix, and use the straight table name for everything else.
Types ¶
Click to show internal directories.
Click to hide internal directories.