xsqlite

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dbPath string, options ...Option) (*gorm.DB, error)

New ...

Types

type Config

type Config struct {
	Password string           `json:"password"`
	Models   []interface{}    `json:"models"`
	Logger   logger.Interface `json:"logger"`
	Debug    bool             `json:"debug"`
	Force    bool             `json:"force"`
}

Config ...

type Model

type Model struct {
	Id        int64     `json:"id" gorm:"column:id;primaryKey;AUTO_INCREMENT;not null"`
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null" comment:"创建时间"`
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;not null" comment:"更新时间"`
}

Model ...

type Option

type Option func(*Config)

Option ...

func WithDebug

func WithDebug() Option

WithDebug 调试模式

func WithForce

func WithForce() Option

WithDebug 强制重连

func WithLogger

func WithLogger(log logger.Interface) Option

WithLogger 日志

func WithModels

func WithModels(models ...interface{}) Option

WithModels model 初始化

func WithPassword

func WithPassword(password string) Option

WithPassword 密码

Jump to

Keyboard shortcuts

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