Add production features: slog adapter, scan helpers, slow query logging, pool stats, tracer passthrough, test tx isolation
Some checks failed
CI / test (push) Failing after 13s
Some checks failed
CI / test (push) Failing after 13s
- slog.go: SlogLogger adapts *slog.Logger to dbx.Logger interface - scan.go: Collect[T] and CollectOne[T] generic helpers using pgx.RowToStructByName - cluster.go: slow query logging via Config.SlowQueryThreshold (Warn level in queryEnd) - stats.go: PoolStats with Cluster.Stats() aggregating pool stats across all nodes - config.go/node.go: NodeConfig.Tracer passthrough for pgx.QueryTracer (OpenTelemetry) - options.go: WithSlowQueryThreshold and WithTracer functional options - dbxtest/tx.go: RunInTx runs callback in always-rolled-back transaction for test isolation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,8 +23,11 @@ You are working on `git.codelab.vc/pkg/dbx`, a Go PostgreSQL cluster library bui
|
||||
- `tx.go` — RunTx, RunTxOptions, InjectQuerier, ExtractQuerier
|
||||
- `errors.go` — IsRetryable, IsConnectionError, IsConstraintViolation, PgErrorCode
|
||||
- `config.go` — Config, NodeConfig, PoolConfig, RetryConfig, HealthCheckConfig
|
||||
- `options.go` — functional options (WithLogger, WithMetrics, WithRetry, WithHealthCheck)
|
||||
- `dbxtest/` — test helpers: NewTestCluster, TestLogger
|
||||
- `options.go` — functional options (WithLogger, WithMetrics, WithRetry, WithHealthCheck, WithSlowQueryThreshold, WithTracer)
|
||||
- `slog.go` — SlogLogger adapting *slog.Logger to dbx.Logger
|
||||
- `scan.go` — Collect[T], CollectOne[T] generic row scan helpers
|
||||
- `stats.go` — PoolStats aggregate pool statistics via Cluster.Stats()
|
||||
- `dbxtest/` — test helpers: NewTestCluster, TestLogger, RunInTx
|
||||
|
||||
## Code conventions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user