code: func InitDB(path string) error {
  	db, err := sql.Open("sqlite3", path)
  	if err != nil {
  		return err
  	}
  	defer db.Close()
  	for _, tableSQL := range SQLCreateTables() {
  		if _, err := db.Exec(tableSQL); err != nil {
  			return err
  		}
  	}
  
  	// Use Write Ahead Logging which improves SQLite concurrency.
  	// Requires SQLite >= 3.7.0
  	if _, err := db.Exec("PRAGMA journal_mode = WAL"); err != nil {
  		return err
  	}
  
  	// Check if the WAL mode was set correctly
  	var journalMode string
  	if err = db.QueryRow("PRAGMA journal_mode").Scan(&journalMode); err != nil {
  		log.Fatalf("Unable to determine sqlite3 journal_mode: %v", err)
  	}
  	if journalMode != "wal" {
  		log.Fatal("SQLite Write Ahead Logging (introducted in v3.7.0) is required. See http://perkeep.org/issue/114")
  	}
  
  	_, err = db.Exec(fmt.Sprintf(`REPLACE INTO meta VALUES ('version', '%d')`, SchemaVersion()))
  	return err
  }
docs: // InitDB creates a new sqlite database based on the file at path.