db

package
v0.0.0-...-83fcdd0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package db 负责打开 SQLite 并建表。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(gdb *gorm.DB) error

Close 关闭数据库连接。

func Open

func Open(path string) (*gorm.DB, error)

Open 打开(必要时创建)SQLite 数据库并执行建表。

使用 glebarez/sqlite(纯 Go 驱动),因此可以 CGO_ENABLED=0 静态编译。 连接池限制为 1:写入来自后台任务、读取来自 HTTP 接口,串行化可以彻底避免 SQLITE_BUSY;WAL 与 busy_timeout 进一步提高并发下的稳定性。

Types

This section is empty.

Jump to

Keyboard shortcuts

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