Beispiel #1
0
/* Does this database need to be upgraded before writing to it?
 *
 * If this function returns TRUE then no functions that modify the
 * database (notmuch_database_add_message, notmuch_message_add_tag,
 * notmuch_directory_set_mtime, etc.) will work unless the function
 * notmuch_database_upgrade is called successfully first. */
func (self *Database) NeedsUpgrade() bool {
	do_upgrade := C.notmuch_database_needs_upgrade(self.db)
	if do_upgrade == 0 {
		return false
	}
	return true
}
Beispiel #2
0
Datei: db.go Projekt: gmuch/gmuch
// NeedsUpgrade returns true if the database can be upgraded. This will always
// return false if the database was opened with DBReadOnly.
//
// If this function returns true then the caller may call
// Upgrade() to upgrade the database.
func (db *DB) NeedsUpgrade() bool {
	cbool := C.notmuch_database_needs_upgrade(db.toC())
	return int(cbool) != 0
}