MCPcopy
hub / github.com/go-gorm/gorm / G

Function G

generics.go:147–165  ·  view source on GitHub ↗
(db *DB, opts ...clause.Expression)

Source from the content-addressed store, hash-verified

145type op func(*DB) *DB
146
147func G[T any](db *DB, opts ...clause.Expression) Interface[T] {
148 v := &g[T]{
149 db: db,
150 ops: make([]op, 0, 5),
151 }
152
153 if len(opts) > 0 {
154 v.ops = append(v.ops, func(db *DB) *DB {
155 return db.Clauses(opts...)
156 })
157 }
158
159 v.createG = &createG[T]{
160 chainG: chainG[T]{
161 execG: execG[T]{g: v},
162 },
163 }
164 return v
165}
166
167type g[T any] struct {
168 *createG[T]

Callers

nothing calls this directly

Calls 1

ClausesMethod · 0.80

Tested by

no test coverage detected