db

package
v0.0.0-...-f869922 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRows    = errors.New("no rows in result set")
	ErrEmptyFile = errors.New("empty migration file")
)

Functions

func NewPostgresPool

func NewPostgresPool(url string) (*postgresConnection, error)

func NewSqlite3Connection

func NewSqlite3Connection(path string) (*sqlite3Connection, error)

func RunPostgresMigrations

func RunPostgresMigrations(ctx context.Context, c *postgresConnection) error

func RunSqlite3Migrations

func RunSqlite3Migrations(ctx context.Context, conn Connection, path string) error

Types

type CommandTag

type CommandTag interface {
	String() string
}

type Connection

type Connection interface {
	Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
	Query(ctx context.Context, query string, args ...interface{}) (Rows, error)
	QueryRow(ctx context.Context, query string, args ...interface{}) Row
	Begin(ctx context.Context) (Connection, error)
	Close()
}

type Result

type Result interface {
	RowsAffected() (int64, error)
}

type Row

type Row interface {
	Scan(...interface{}) error
}

type Rows

type Rows interface {
	Next() bool
	Scan(...interface{}) error
	Close() error
	Err() error
}

Jump to

Keyboard shortcuts

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