Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*config)
Option configures the database connection.
func WithConnMaxLifetime ¶
WithConnMaxLifetime sets the maximum amount of time a connection may be reused.
func WithMaxIdleConns ¶
WithMaxIdleConns sets the maximum number of idle connections in the pool.
func WithMaxOpenConns ¶
WithMaxOpenConns sets the maximum number of open connections to the database.
func WithPingTimeout ¶
WithPingTimeout sets the timeout for the connect-time ping (default 5 s).
func WithTracing ¶
func WithTracing() Option
WithTracing installs Bun's OpenTelemetry query hook so each query is recorded as a span on the active trace. It requires a configured tracer provider (see the tracing package's Setup); without one, spans are dropped.
Click to show internal directories.
Click to hide internal directories.