mirror of
https://github.com/glebarez/go-sqlite.git
synced 2025-10-05 07:46:50 +08:00
5397b34f827e2bb8c1bcd83c4b531039de9212c6
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... 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%