package
0.4.1
Repository: https://github.com/goplugin/plugin-common.git
Documentation: pkg.go.dev

# Functions

Batch is an iterator for batches of records.
MonitorHook returns a [QueryHook] that measures the timing of each query and logs about slow queries at increasing levels of severity.
NamedQueryContext is like sqlx.NamedQueryContext, but it works with any DataSource.
TimeoutHook returns a [QueryHook] which adds the defaultTimeout to each context.Context, unless [WithoutDefaultTimeout] has been applied to bypass intentionally.
Transact is a helper for executing transactions with a domain specific type.
TransactConn is a special case to support *sqlx.Conn, which does not implement the full DataSource interface.
TransactDataSource is a helper for executing transactions.
WithoutDefaultTimeout makes a [context.Context] exempt from the default timeout normally applied by a [TimeoutHook].
WrapDataSource returns a new [DataSource] that calls each [QueryHook] in the provided order.

# Variables

PromSQLQueryTime is exported temporarily while transitioning the core ORMs.

# Structs

LogThresholds holds funcs for computing thresholds for timeout usage.
No description provided by the author

# Interfaces

DataSource is implemented by [*sqlx.DB] & [*sqlx.Tx].
No description provided by the author

# Type aliases

BatchFunc is the function to execute on each batch of records, should return the count of records affected.
JSON defined JSON data type, need to implements driver.Valuer, sql.Scanner interface.
No description provided by the author
QueryHook is a func that is executed for each query, providing an opportunity to measure, log, inspect/modify errors, etc.