postgres

package
v0.1.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDriver = "postgres"

Variables

This section is empty.

Functions

func New

func New(cfg Config) (*bridgesql.DB, error)

func NewRouter

func NewRouter(cfg RouterConfig) (*bridgesql.Router, error)

Types

type Config

type Config struct {
	Name               string
	DSN                string
	Driver             string
	DB                 *stdsql.DB
	Hooks              []capsql.QueryHook
	SlowQueryThreshold time.Duration
	SlowQueryHook      bridgesql.SlowQueryHook
	MaxOpenConns       int
	MaxIdleConns       int
	ConnMaxLifetime    time.Duration
	ConnMaxIdleTime    time.Duration
	PingTimeout        time.Duration
	HealthQuery        string
}

type RouterConfig

type RouterConfig struct {
	Name    string
	Writer  capsql.DB
	Readers []capsql.DB
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL