sqlite

package
v0.0.0-...-ff1ea2f Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDBFile

func CreateDBFile(dbPath string) error

func Open

func Open(dbPath string, db *DB, opts ...gorm.Option) error

Open 创建数据库连接

Types

type DB

type DB struct {
	Orm *gorm.DB
}

func (*DB) Create

func (d *DB) Create(table string, dst ...interface{}) error

Create 创建数据表

func (*DB) CreateAndFirstOrCreate

func (d *DB) CreateAndFirstOrCreate(table string, dest interface{}, conds ...interface{}) error

CreateAndFirstOrCreate 创建数据表并创建第一条数据,如果已有一条数据则不创建

Jump to

Keyboard shortcuts

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