db

package
v0.0.0-...-bfc6946 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migration

func Migration(sqlDir string, session *dbr.Session) error

func NewMySQL

func NewMySQL(addr string) *dbr.Session

NewMySQL 创建一个MySQL db,[path]db存储路径 [sqlDir]sql脚本目录

func NewRedis

func NewRedis(ctx context.Context, addr string, password string) *redis.Conn

func NewSqlite

func NewSqlite(filepath string, sqlDir string) *dbr.Session

Types

type BaseModel

type BaseModel struct {
	Id        int64
	CreatedAt Time
	UpdatedAt Time
}

type FileDirMigrationSource

type FileDirMigrationSource struct {
	Dir string
}

FileDirMigrationSource 文件目录源 遇到目录进行递归获取

func (FileDirMigrationSource) FindMigrations

func (f FileDirMigrationSource) FindMigrations() ([]*migrate.Migration, error)

FindMigrations FindMigrations

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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