dao

package
v0.0.0-...-9ff4ced Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TIMEOUT_THRESHOLD = 5 * time.Second

Variables

This section is empty.

Functions

func Close

func Close(dbObj *gorm.DB) error

func Migrate

func Migrate(dbObj *gorm.DB, tableImpl Table) error

func Open

func Open(host string, port int, engineName, username, password, database string) (*gorm.DB, error)

Types

type BaseTable

type BaseTable struct {
	// This field is the primary key of the table
	PrimaryKey uint64 `gorm:"primary_key"`
	CreatedAt  int64  `gorm:"column:created_at;autoUpdateTime:milli;<-:create"`
}

type Engine

type Engine interface {
	Open(host string, port int, username, password, database string, timeout time.Duration) (*gorm.DB, error)
}

type Table

type Table interface {
	GetModel() any
	GetName() string
}

Directories

Path Synopsis
engine

Jump to

Keyboard shortcuts

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