db

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package db defines the database types and functions.

Package db defines the database types and functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int4ToInt32 added in v0.3.0

func Int4ToInt32(pgInt4 pgtype.Int4) int32

Int4ToInt32 extracts a Go int32 from pgtype.Int4, returning 0 if null

func ListMigrations added in v0.0.9

func ListMigrations() ([]string, error)

ListMigrations returns a list of all migration files

func NewInt4 added in v0.1.0

func NewInt4(t int64) pgtype.Int4

func NewString added in v0.0.6

func NewString(s string) pgtype.Text

NewString returns a new pgtype.Text

func NewTimestamp added in v0.0.6

func NewTimestamp(t time.Time) pgtype.Timestamp

NewTimestamp returns a new pgtype.Timestamp

func TextToString added in v0.3.0

func TextToString(pgText pgtype.Text) string

TextToString extracts a Go string from pgtype.Text, returning empty string if null

func ViewMigration added in v0.0.9

func ViewMigration(file string) []byte

Types

type MigrationHandler

type MigrationHandler struct {
	*migrate.Migrate
}

func NewMigrationHandler

func NewMigrationHandler() (*MigrationHandler, error)

func (*MigrationHandler) ForceVersion added in v0.0.10

func (m *MigrationHandler) ForceVersion(version int)

func (*MigrationHandler) MigrationStep

func (m *MigrationHandler) MigrationStep(step int)

func (*MigrationHandler) RunMigrations

func (m *MigrationHandler) RunMigrations() error

Directories

Path Synopsis
types
flags
Package flags contains all the bitmask based flags used in the database.
Package flags contains all the bitmask based flags used in the database.

Jump to

Keyboard shortcuts

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