The official SQLite driver for GORM, based on go-sqlite3 (requires CGO).
import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{})For full documentation, visit https://gorm.io.
If you need a CGO-free SQLite driver, the following community projects are available:
Usage is identical — simply swap the import path:
import (
"github.com/glebarez/sqlite" // or "github.com/libtnb/sqlite"
"gorm.io/gorm"
)
db, err := gorm.Open(sqlite.Open("gorm.db"), &gorm.Config{})