Skip to content

Repository files navigation

GORM SQLite Driver

CI

The official SQLite driver for GORM, based on go-sqlite3 (requires CGO).

Quick Start

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.

Pure Go Alternatives

If you need a CGO-free SQLite driver, the following community projects are available:

Driver Repository
github.com/glebarez/sqlite github.com/glebarez/sqlite
github.com/libtnb/sqlite github.com/libtnb/sqlite
github.com/ncruces/go-sqlite3/gormlite github.com/ncruces/go-sqlite3

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{})

About

GORM sqlite driver

Topics

Resources

Stars

231 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages