Function
G
(db *DB, opts ...clause.Expression)
Source from the content-addressed store, hash-verified
| 145 | type op func(*DB) *DB |
| 146 | |
| 147 | func 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 | |
| 167 | type g[T any] struct { |
| 168 | *createG[T] |
Callers
nothing calls this directly
Tested by
no test coverage detected