Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( AgentName = "common:sql:agent/request/postgres" StatusTxnBeginError = int(102) // Transaction processing begin error StatusTxnRollbackError = int(103) // Transaction processing rollback error StatusTxnCommitError = int(104) // Transaction processing commit error StatusExecError = int(105) // Execution error, as in a database call StatusNotStarted = int(98) // Not started )
Variables ¶
View Source
var Requester = func() *Interface { return &Interface{ Execute: func(ctx context.Context, name, sql string, args ...any) (Result, error) { if ctx == nil { ctx = context.Background() } start := time.Now().UTC() tag, err := agent.exec(ctx, sql, args) agent.log(start, time.Since(start), routeName, newExecRequest(name), newResponse(agent.statusCode(err)), ctx) return tag, err }, } }()
Requester -
Functions ¶
Types ¶
type Interface ¶
type Interface struct {
Execute func(ctx context.Context, name, sql string, args ...any) (Result, error)
}
Interface - TODO : determine if a bulk insert is needed
Click to show internal directories.
Click to hide internal directories.