Sqlite
Package sqlite provides sqlite database driver.
Installation
go get -u github.com/gopi-frame/database/sqlite
Import
import _ "github.com/gopi-frame/database/sqlite"
Usage
package main
import (
"github.com/gopi-frame/database"
_ "github.com/gopi-frame/database/sqlite"
)
func main() {
db, err := database.Connect("sqlite", map[string]any{
"dsn": "file:test.db",
})
if err != nil {
panic(err)
}
}
Options
This package uses package mapstructure to parse options.
For more information on the options, see sqlite.Config.
Example
var options = map[string]any{
"dsn": "file:test.db",
}