mirror of
https://github.com/glebarez/go-sqlite.git
synced 2025-11-03 01:53:28 +08:00
d7fca1de762c33bdda338956483fdc3bd790cd87
Bumps [modernc.org/libc](https://gitlab.com/cznic/libc) from 1.14.3 to 1.14.5. - [Release notes](https://gitlab.com/cznic/libc/tags) - [Commits](https://gitlab.com/cznic/libc/compare/v1.14.3...v1.14.5) --- updated-dependencies: - dependency-name: modernc.org/libc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
go-sqlite
This is a pure-Go SQLite driver for Golang's native database/sql package.
This driver is based on pure-Go implementation of SQLite (https://gitlab.com/cznic/sqlite), and has SQLite embedded.
Usage
Example
package main
import (
"database/sql"
"log"
_ "github.com/glebarez/go-sqlite"
)
func main() {
// connect
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
log.Fatal(err)
}
// get SQLite version
_ := db.QueryRow("select sqlite_version()")
}
Connection string examples
- in-memory SQLite:
":memory:" - on-disk SQLite:
"path/to/some.db" - Foreign-key constraint activation:
":memory:?_pragma=foreign_keys(1)"
Languages
Go
100%