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

Method New

internal/stmt_store/stmt_store.go:48–48  ·  view source on GitHub ↗

New creates a new Stmt object and caches it. Parameters: ctx: The context for the request, which can carry deadlines, cancellation signals, etc. key: The key representing the SQL query, used for caching and preparing the statement. isTransaction: Indicates whether this operation is part of a transac

(ctx context.Context, key string, isTransaction bool, connPool ConnPool, locker sync.Locker)

Source from the content-addressed store, hash-verified

46 // *Stmt: A newly created statement object for executing SQL operations.
47 // error: An error if the statement preparation fails.
48 New(ctx context.Context, key string, isTransaction bool, connPool ConnPool, locker sync.Locker) (*Stmt, error)
49
50 // Keys returns a slice of all cache keys in the store.
51 Keys() []string

Callers 15

prepareValuesFunction · 0.65
scanIntoStructMethod · 0.65
ScanFunction · 0.65
prepareMethod · 0.65
SetColumnMethod · 0.65
ExecuteMethod · 0.65
CreateInBatchesMethod · 0.65
ScanMethod · 0.65
ScanRowsMethod · 0.65
errors.goFile · 0.65
handleAssociationMethod · 0.65
ReplaceMethod · 0.65

Implementers 1

lruStoreinternal/stmt_store/stmt_store.go

Calls

no outgoing calls

Tested by 15

TestAssertEqualFunction · 0.52
TestSlogLoggerFunction · 0.52
TestTransactionWithBlockFunction · 0.52
BeforeCreateMethod · 0.52
BeforeUpdateMethod · 0.52
BeforeSaveMethod · 0.52
AfterSaveMethod · 0.52
BeforeDeleteMethod · 0.52
AfterDeleteMethod · 0.52