1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-23 14:07:13 +02:00
pocketbase/core/db_nocgo.go

23 lines
317 B
Go
Raw Normal View History

2022-07-07 00:19:05 +03:00
//go:build !cgo
package core
import (
"github.com/pocketbase/dbx"
_ "modernc.org/sqlite"
)
func connectDB(dbPath string) (*dbx.DB, error) {
db, err := dbx.Open("sqlite", dbPath)
if err != nil {
return nil, err
}
if err := initPragmas(db); err != nil {
db.Close()
return nil, err
}
return db, nil
2022-07-07 00:19:05 +03:00
}