Exemple #1
0
// RepoDB opens a sqlite based repo database.
func RepoDB(path string) (repodb.DB, error) {
	ret, err := reposql.Open(path)
	if err != nil {
		return nil, err
	}
	return ret, nil
}
Exemple #2
0
func openDB() repodb.DB {
	if *useMysql {
		db, err := repomy.Open(*dbPath)
		if err != nil {
			log.Fatal(err)
		}
		return db
	}

	db, err := repolite.Open(*dbPath)
	if err != nil {
		log.Fatal(err)
	}
	return db
}