package db

import "fmt"

// Snapshot creates a consistent backup of the database using VACUUM INTO.
func (s *Store) Snapshot(destPath string) error {
	_, err := s.db.Exec("VACUUM INTO ?", destPath)
	if err != nil {
		return fmt.Errorf("snapshot to %q: %w", destPath, err)
	}
	return nil
}
