Skip to content

Commit

Permalink
Switch to in memory DB for temp dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
chand1012 committed Feb 24, 2024
1 parent 21ba72a commit 416c9c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Binary file added img/social_banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions pkg/db/load_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@ import (
)

func createTempDB() (*sql.DB, string, error) {
tmpFile, err := os.CreateTemp(os.TempDir(), "sq-*.sql")
if err != nil {
return nil, "", err
}
defer tmpFile.Close()

db, err := sql.Open("sqlite", tmpFile.Name())
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
return nil, "", err
}

return db, tmpFile.Name(), nil
return db, "", nil
}

// check if the file is a valid sqlite db
Expand Down

0 comments on commit 416c9c2

Please sign in to comment.