MCPcopy
hub / github.com/gtsteffaniak/filebrowser / Close

Method Close

backend/database/sql/sqlite.go:415–434  ·  view source on GitHub ↗

Close closes the database connection and removes the temporary file if it is not persistent.

()

Source from the content-addressed store, hash-verified

413
414// Close closes the database connection and removes the temporary file if it is not persistent.
415func (t *TempDB) Close() error {
416 t.mu.Lock()
417 defer t.mu.Unlock()
418
419 if t.db != nil {
420 if err := t.db.Close(); err != nil {
421 // Only remove file if it's not persistent
422 if t.config != nil && t.config.PersistentFile == "" {
423 os.Remove(t.path)
424 }
425 return err
426 }
427 }
428
429 // Only remove file if it's not persistent
430 if t.config != nil && t.config.PersistentFile == "" {
431 return os.Remove(t.path)
432 }
433 return nil
434}
435
436// verifyPragmaSettings reads back PRAGMA values to verify they were applied correctly
437func verifyPragmaSettings(db *sql.DB, cfg *TempDBConfig) error {

Callers 15

rawFileHandlerFunction · 0.80
OpenFileMethod · 0.80
computeHeaderChecksumFunction · 0.80
computeMiddleChecksumFunction · 0.80
archiveCreateHandlerFunction · 0.80
addSingleFileFunction · 0.80
createZipFunction · 0.80
createTarGzFunction · 0.80
createTarGzWithLevelFunction · 0.80
BuildAndStreamArchiveFunction · 0.80
extractZipFunction · 0.80

Calls 1

RemoveMethod · 0.80