db

package
v0.0.0-...-262adbd Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Migrations embed.FS

Functions

func Migrate

func Migrate(database *sql.DB, verbose bool) error

func PostgresDSN

func PostgresDSN(host string, port int, user, pass, name string) string

Types

type Executor

type Executor interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
	QueryRow(query string, args ...interface{}) *sql.Row
	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
}

Executor is an interface that wraps methods for executing SQL queries via sql.DB or sql.Tx.

type Pagination

type Pagination struct {
	Limit int `json:"limit"`
	Page  int `json:"page"`
}

func (*Pagination) Offset

func (p *Pagination) Offset() int

Jump to

Keyboard shortcuts

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