Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DriverPostgres represents the postgres dialect. DriverPostgres = "pgx" // DriverTxWrappedPostgres is useful for tests. // When the connection is opened, it starts a transaction and all // operations performed on the DB will be within that transaction. DriverTxWrappedPostgres = "txdb" // DriverInMemoryPostgres uses an in memory database, github.com/marcboeker/go-duckdb. DriverInMemoryPostgres = "duckdb" )
Variables ¶
This section is empty.
Functions ¶
func SetApplicationName ¶ added in v0.5.0
Types ¶
type DBConfig ¶ added in v0.5.0
type DBConfig struct {
IdleInTxSessionTimeout time.Duration // idle_in_transaction_session_timeout
LockTimeout time.Duration // lock_timeout
MaxOpenConns, MaxIdleConns int
EnableTracing bool
}
func (DBConfig) WithTracing ¶ added in v0.9.0
type DialectName
deprecated
type DialectName string
Deprecated: Use Driver* constants
const ( // Deprecated: Use DriverPostgres Postgres DialectName = DriverPostgres // Deprecated: Use DriverTxWrappedPostgres TransactionWrappedPostgres DialectName = DriverTxWrappedPostgres // Deprecated: Use DriverTxWrappedPostgres DriverInMemoryPostgres InMemoryPostgres DialectName = DriverInMemoryPostgres )
type StatsReporter ¶ added in v0.5.0
type StatsReporter struct {
// contains filtered or unexported fields
}
func NewStatsReporter ¶ added in v0.5.0
func NewStatsReporter(fn StatFn, lggr logger.Logger, opts ...StatsReporterOpt) *StatsReporter
func (*StatsReporter) Start ¶ added in v0.5.0
func (r *StatsReporter) Start()
func (*StatsReporter) Stop ¶ added in v0.5.0
func (r *StatsReporter) Stop()
Stop stops all resources owned by the reporter and waits for all of them to be done
type StatsReporterOpt ¶ added in v0.5.0
type StatsReporterOpt func(*StatsReporter)
func StatsCustomReporterFn ¶ added in v0.5.0
func StatsCustomReporterFn(fn ReportFn) StatsReporterOpt
func StatsInterval ¶ added in v0.5.0
func StatsInterval(d time.Duration) StatsReporterOpt
Click to show internal directories.
Click to hide internal directories.