netplay-lobby-server-go/model/sqlite.go
2024-12-24 22:09:17 +08:00

13 lines
310 B
Go

package model
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
)
// GetSqliteDB returns a sqlite3 interface using GORM.
// A filepath of ":memory:" provides a in memory database.
func GetSqliteDB(connection string) (*gorm.DB, error) {
return gorm.Open("sqlite3", connection)
}