mirror of
https://github.com/ghostersk/gowebmail.git
synced 2026-04-17 16:46:01 +01:00
fix embeding issue and sqlite db new database string
This commit is contained in:
@@ -27,7 +27,8 @@ func New(path string, encKey []byte) (*DB, error) {
|
||||
}
|
||||
|
||||
// Enable WAL mode and foreign keys for performance and integrity
|
||||
dsn := fmt.Sprintf("%s?_journal_mode=WAL&_foreign_keys=on&_busy_timeout=5000", path)
|
||||
// sqlite file path must start with `file:` for package mattn/go-sqlite3
|
||||
dsn := fmt.Sprintf("file:%s?_journal_mode=WAL&_foreign_keys=on&_busy_timeout=5000", path)
|
||||
sqlDB, err := sql.Open("sqlite3", dsn)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("open sqlite: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user