[PATCH 5/7] go: Partially bind notmuch_database_upgrade
[notmuch-archives.git] / 81 / 0a0d75f2241d29a3842b99f92aa8303c2b28e2
1 Return-Path: <adrien@bustany.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 92A63431FC7\r
6         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id AxF+L66LRTCq for <notmuch@notmuchmail.org>;\r
16         Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\r
17 X-Greylist: delayed 384 seconds by postgrey-1.32 at olra;\r
18         Wed, 18 Jul 2012 11:41:04 PDT\r
19 Received: from mail.bustany.org (bustany.org [176.31.244.208])\r
20         by olra.theworths.org (Postfix) with ESMTP id D7E7C431FAF\r
21         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:04 -0700 (PDT)\r
22 Received: from localhost.localdomain (91-158-2-79.elisa-laajakaista.fi\r
23         [91.158.2.79])\r
24         by mail.bustany.org (Postfix) with ESMTPSA id 256B11400D7\r
25         for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 20:37:09 +0200 (CEST)\r
26 From: Adrien Bustany <adrien@bustany.org>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH 5/7] go: Partially bind notmuch_database_upgrade\r
29 Date: Wed, 18 Jul 2012 21:34:33 +0300\r
30 Message-Id: <1342636475-16057-6-git-send-email-adrien@bustany.org>\r
31 X-Mailer: git-send-email 1.7.7.6\r
32 In-Reply-To: <1342636475-16057-1-git-send-email-adrien@bustany.org>\r
33 References: <1342636475-16057-1-git-send-email-adrien@bustany.org>\r
34 X-BeenThere: notmuch@notmuchmail.org\r
35 X-Mailman-Version: 2.1.13\r
36 Precedence: list\r
37 List-Id: "Use and development of the notmuch mail system."\r
38         <notmuch.notmuchmail.org>\r
39 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
41 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
42 List-Post: <mailto:notmuch@notmuchmail.org>\r
43 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
44 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
46 X-List-Received-Date: Wed, 18 Jul 2012 18:41:05 -0000\r
47 \r
48 This binding does not handle the progress callback, but at least allows\r
49 opening and upgrading a database if needed.\r
50 ---\r
51  bindings/go/src/notmuch/notmuch.go |   13 ++++++++++++-\r
52  1 files changed, 12 insertions(+), 1 deletions(-)\r
53 \r
54 diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go\r
55 index d8b2739..384d5a5 100644\r
56 --- a/bindings/go/src/notmuch/notmuch.go\r
57 +++ b/bindings/go/src/notmuch/notmuch.go\r
58 @@ -296,7 +296,18 @@ func (self *Database) NeedsUpgrade() bool {\r
59         return true\r
60  }\r
61  \r
62 -// TODO: notmuch_database_upgrade\r
63 +// TODO: Proper notmuch_database_upgrade\r
64 +/* Upgrade the current database.\r
65 + *\r
66 + * After opening a database in read-write mode, the client should\r
67 + * check if an upgrade is needed (notmuch_database_needs_upgrade) and\r
68 + * if so, upgrade with this function before making any modifications.\r
69 + */\r
70 +func (self *Database) Upgrade() Status {\r
71 +       st := Status(C.notmuch_database_upgrade(self.db, nil, nil));\r
72 +\r
73 +       return st;\r
74 +}\r
75  \r
76  /* Retrieve a directory object from the database for 'path'.\r
77   *\r
78 -- \r
79 1.7.7.6\r
80 \r