Help us shape the future of Go! Take the 2026 Go Developer Survey

plugins

package
v0.19.1252 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallObjMethod

func CallObjMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool)

This CallObjMethod function, is copied from https://raw.githubusercontent.com/go-gorm/gorm/master/callbacks/callmethod.go, which is how the gorm hooks dispatch calls to model functions.

func TableName

func TableName(db *gorm.DB, obj any) string

func TableNameOf added in v0.19.1197

func TableNameOf[T any, PT interface {
	*T
	Tabler
}]() string

TableNameOf returns a model's table name from its Tabler implementation, for callers without a db handle such as temporal workflow code. Usage: TableNameOf[app.Install]().

Types

type Tabler

type Tabler interface {
	TableName() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL