Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMigrationVersionWithDB added in v0.17.0

func GetMigrationVersionWithDB(gormDB *gorm.DB) (uint, bool, error)

GetMigrationVersionWithDB returns the current migration version using an existing GORM database instance

func IsDuplicateKeyError added in v0.5.15

func IsDuplicateKeyError(err error) bool

func NewConnection

func NewConnection(host, user, password, dbname, port string) (*gorm.DB, error)

func RunMigrationsWithDB added in v0.17.0

func RunMigrationsWithDB(gormDB *gorm.DB) error

RunMigrationsWithDB runs all pending database migrations using an existing GORM database instance

Types

type JSONB added in v0.17.0

type JSONB map[string]any

func JSONbFromStruct added in v0.17.0

func JSONbFromStruct(m any) (JSONB, error)

func MustJSONBFromStruct added in v0.17.0

func MustJSONBFromStruct(m any) JSONB

func (*JSONB) Scan added in v0.17.0

func (jsonField *JSONB) Scan(value any) error

Scan Unmarshal

func (JSONB) Value added in v0.17.0

func (jsonField JSONB) Value() (driver.Value, error)

Value Marshal

type PageInfo

type PageInfo struct {
	Total    int64 `json:"total"`
	PageSize int   `json:"pageSize"`
	Page     int   `json:"page"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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