Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 92A63431FC7 for ; Wed, 18 Jul 2012 11:41:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AxF+L66LRTCq for ; Wed, 18 Jul 2012 11:41:05 -0700 (PDT) X-Greylist: delayed 384 seconds by postgrey-1.32 at olra; Wed, 18 Jul 2012 11:41:04 PDT Received: from mail.bustany.org (bustany.org [176.31.244.208]) by olra.theworths.org (Postfix) with ESMTP id D7E7C431FAF for ; Wed, 18 Jul 2012 11:41:04 -0700 (PDT) Received: from localhost.localdomain (91-158-2-79.elisa-laajakaista.fi [91.158.2.79]) by mail.bustany.org (Postfix) with ESMTPSA id 256B11400D7 for ; Wed, 18 Jul 2012 20:37:09 +0200 (CEST) From: Adrien Bustany To: notmuch@notmuchmail.org Subject: [PATCH 5/7] go: Partially bind notmuch_database_upgrade Date: Wed, 18 Jul 2012 21:34:33 +0300 Message-Id: <1342636475-16057-6-git-send-email-adrien@bustany.org> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1342636475-16057-1-git-send-email-adrien@bustany.org> References: <1342636475-16057-1-git-send-email-adrien@bustany.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 18:41:05 -0000 This binding does not handle the progress callback, but at least allows opening and upgrading a database if needed. --- bindings/go/src/notmuch/notmuch.go | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go index d8b2739..384d5a5 100644 --- a/bindings/go/src/notmuch/notmuch.go +++ b/bindings/go/src/notmuch/notmuch.go @@ -296,7 +296,18 @@ func (self *Database) NeedsUpgrade() bool { return true } -// TODO: notmuch_database_upgrade +// TODO: Proper notmuch_database_upgrade +/* Upgrade the current database. + * + * After opening a database in read-write mode, the client should + * check if an upgrade is needed (notmuch_database_needs_upgrade) and + * if so, upgrade with this function before making any modifications. + */ +func (self *Database) Upgrade() Status { + st := Status(C.notmuch_database_upgrade(self.db, nil, nil)); + + return st; +} /* Retrieve a directory object from the database for 'path'. * -- 1.7.7.6