From 2a8cf365735df5715a5a8bda398215899366d321 Mon Sep 17 00:00:00 2001 From: Ben Krieger Date: Mon, 7 Oct 2024 19:54:35 -0400 Subject: [PATCH] Add sqlite.NewDB Signed-off-by: Ben Krieger --- sqlite/sqlite.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sqlite/sqlite.go b/sqlite/sqlite.go index f468602..f812494 100644 --- a/sqlite/sqlite.go +++ b/sqlite/sqlite.go @@ -159,7 +159,13 @@ func Init(db *sql.DB) (*DB, error) { } } - return &DB{db: db}, nil + return NewDB(db), nil +} + +// NewDB creates a new database from a standard connection. It is expected that +// all tables, pragma, and VFS have already been initialized. +func NewDB(db *sql.DB) *DB { + return &DB{db: db} } // Close closes the database connection.