| 573 | } |
| 574 | |
| 575 | func (s *SQLite) Validate() error { |
| 576 | if s.DBFile == "" { |
| 577 | return fmt.Errorf("no valid db_file was specified") |
| 578 | } |
| 579 | |
| 580 | if !filepath.IsAbs(s.DBFile) { |
| 581 | return fmt.Errorf("please specify an absolute path for db_file") |
| 582 | } |
| 583 | |
| 584 | parent := filepath.Dir(s.DBFile) |
| 585 | if _, err := os.Stat(parent); err != nil { |
| 586 | return fmt.Errorf("parent directory of db_file does not exist: %w", err) |
| 587 | } |
| 588 | return nil |
| 589 | } |
| 590 | |
| 591 | func (s *SQLite) BlobDBFile() (string, error) { |
| 592 | if err := s.Validate(); err != nil { |