db

package
v0.1.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Overview

Package db opens the PostgreSQL pool and applies the embedded schema migrations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, pool *pgxpool.Pool, logger *slog.Logger) error

Migrate applies every pending migration. A Postgres advisory lock makes it safe when several panel instances start at the same time.

func Open

func Open(ctx context.Context, url string) (*pgxpool.Pool, error)

Open connects to PostgreSQL and verifies the connection.

func Status

func Status(ctx context.Context, pool *pgxpool.Pool) (current int64, pending int, err error)

Status reports the applied schema version and the number of pending migrations, without changing anything.

Types

This section is empty.

Directories

Path Synopsis
Package dbtest gives tests a fresh, migrated PostgreSQL database.
Package dbtest gives tests a fresh, migrated PostgreSQL database.

Jump to

Keyboard shortcuts

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