File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # GORM Sqlite Driver
1+ # GORM SQLite Driver
22
3- ![ CI] ( https://github.com/go-gorm/sqlite/workflows/CI/badge.svg )
3+ [ ![ CI] ( https://github.com/go-gorm/sqlite/workflows/CI/badge.svg )] ( https://github.com/go-gorm/sqlite/actions )
44
5- ## USAGE
5+ The official SQLite driver for [ GORM] ( https://gorm.io ) , based on [ go-sqlite3] ( https://github.com/mattn/go-sqlite3 ) (requires CGO).
6+
7+ ## Quick Start
68
79``` go
810import (
911 " gorm.io/driver/sqlite"
1012 " gorm.io/gorm"
1113)
1214
13- // github.com/mattn/go-sqlite3
1415db , err := gorm.Open (sqlite.Open (" gorm.db" ), &gorm.Config {})
1516```
1617
17- Checkout [ https://gorm.io ] ( https://gorm.io ) for details.
18+ > For full documentation, visit [ https://gorm.io ] ( https://gorm.io ) .
19+
20+ ## Pure Go Alternatives
21+
22+ If you need a CGO-free SQLite driver, the following community projects are available:
1823
19- ### Pure go Sqlite Driver
24+ | Driver | Repository |
25+ | --------| ------------|
26+ | [ github.com/glebarez/sqlite] ( https://pkg.go.dev/github.com/glebarez/sqlite ) | [ github.com/glebarez/sqlite] ( https://github.com/glebarez/sqlite ) |
27+ | [ github.com/libtnb/sqlite] ( https://pkg.go.dev/github.com/libtnb/sqlite ) | [ github.com/libtnb/sqlite] ( https://github.com/libtnb/sqlite ) |
28+ | [ github.com/ncruces/go-sqlite3/gormlite] ( https://pkg.go.dev/github.com/ncruces/go-sqlite3/gormlite ) | [ github.com/ncruces/go-sqlite3] ( https://github.com/ncruces/go-sqlite3 ) |
2029
21- checkout [ https://github.com/glebarez/sqlite ] ( https://github.com/glebarez/sqlite ) for details
30+ Usage is identical — simply swap the import path:
2231
2332``` go
2433import (
25- " github.com/glebarez/sqlite"
34+ " github.com/glebarez/sqlite" // or "github.com/libtnb/sqlite"
2635 " gorm.io/gorm"
2736)
2837
You can’t perform that action at this time.
0 commit comments