embedded

package
v0.1.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeConfig

func DecodeConfig(input any) (database.Connector, error)

func NewConnector

func NewConnector(options Options) database.Connector

func StartEmbedded

func StartEmbedded() (connector database.Connector, stop func(), err error)

StartEmbedded starts an embedded postgres v18 instance and returns a database connector and a stop function. The database is started on a random port and, by default, data is stored in a temporary directory. It is used by embedded-postgres smoke tests and callers that need isolated storage.

func StartEmbeddedWithOptions

func StartEmbeddedWithOptions(options Options) (connector database.Connector, stop func(), err error)

StartEmbeddedWithOptions starts embedded Postgres with explicit runtime/data paths. When DataPath is outside RuntimePath, Postgres data is reused across restarts.

Types

type Options

type Options struct {
	RuntimePath  string
	DataPath     string
	CachePath    string
	LogPath      string
	Logger       io.Writer
	RemoveOnStop bool
}

Options controls where embedded Postgres stores its runtime and data.

type Pool

type Pool struct {
	*postgres.Pool
	// contains filtered or unexported fields
}

func (*Pool) Close

func (p *Pool) Close(ctx context.Context) error

func (*Pool) Connect

func (e *Pool) Connect(ctx context.Context) (database.Pool, error)

Connect implements database.Connector.

Jump to

Keyboard shortcuts

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