forked fromglebarez/go-sqlite
- Notifications
You must be signed in to change notification settings - Fork0
pure-Go SQLite driver for Go (SQLite embedded)
License
NotificationsYou must be signed in to change notification settings
go-sigma/go-sqlite
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is a pure-Go SQLite driver for Golang's nativedatabase/sql package.The driver hasGo-based implementation of SQLite embedded in itself (so, you don't need to install SQLite separately)
package mainimport ("database/sql""log"_"github.com/glebarez/go-sqlite")funcmain() {// connectdb,err:=sql.Open("sqlite",":memory:")iferr!=nil {log.Fatal(err)}// get SQLite version_:=db.QueryRow("select sqlite_version()")}
- in-memory SQLite:
":memory:" - on-disk SQLite:
"path/to/some.db" - Foreign-key constraint activation:
":memory:?_pragma=foreign_keys(1)"
Any SQLIte pragma can be preset for a Database connection using_pragma query parameter. Examples:
- journal mode:
path/to/some.db?_pragma=journal_mode(WAL) - busy timeout:
:memory:?_pragma=busy_timeout(5000)
Multiple PRAGMAs can be specified, e.g.:path/to/some.db?_pragma=busy_timeout(5000)&_pragma=journal_mode(WAL)
About
pure-Go SQLite driver for Go (SQLite embedded)
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Languages
- Go100.0%