コード例 #1
0
ファイル: notmuch.go プロジェクト: vlmarek/notmuch-solaris
/* 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
}
コード例 #2
0
ファイル: db.go プロジェクト: 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
}