All import paths updated to git.wntrmute.dev/mc/. Bumps mcdsl to v1.2.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
24 lines
461 B
Go
24 lines
461 B
Go
package db
|
|
|
|
import (
|
|
"database/sql"
|
|
"fmt"
|
|
|
|
mcdsldb "git.wntrmute.dev/mc/mcdsl/db"
|
|
)
|
|
|
|
// DB wraps a SQLite database connection.
|
|
type DB struct {
|
|
*sql.DB
|
|
}
|
|
|
|
// Open opens (or creates) a SQLite database at the given path with the
|
|
// standard Metacircular pragmas: WAL mode, foreign keys, busy timeout.
|
|
func Open(path string) (*DB, error) {
|
|
sqlDB, err := mcdsldb.Open(path)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("db: %w", err)
|
|
}
|
|
return &DB{sqlDB}, nil
|
|
}
|