database error
[notmuch-archives.git] / fe / 3d0f4480bca43968392c4a04e70c70509d139a
1 Return-Path: <sebastien.binet@cern.ch>\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 CD733431FBC\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 01:31:24 -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: -5\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_HI=-5] 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 Y4yLn3wUnud5 for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Jul 2012 01:31:24 -0700 (PDT)\r
17 X-Greylist: delayed 322 seconds by postgrey-1.32 at olra;\r
18         Mon, 09 Jul 2012 01:31:24 PDT\r
19 Received: from CERNMX30.cern.ch (cernmx30.cern.ch [137.138.144.177])\r
20         (using TLSv1 with cipher AES128-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 09BFE431FAE\r
23         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 01:31:23 -0700 (PDT)\r
24 Received: from CERNFE22.cern.ch (137.138.144.151) by cernmxgwlb2.cern.ch\r
25         (137.138.144.177) with Microsoft SMTP Server (TLS) id 14.2.283.3;\r
26         Mon, 9 Jul 2012 10:25:58 +0200\r
27 Received: from localhost (134.158.88.68) by smtp.cern.ch (137.138.144.172)\r
28         with Microsoft SMTP Server (TLS) id 14.2.298.4; Mon, 9 Jul 2012 10:25:58\r
29         +0200\r
30 From: Sebastien Binet <binet@cern.ch>\r
31 To: Notmuch developer list <notmuch@notmuchmail.org>\r
32 CC: \r
33 Subject: query on a subset of messages ?\r
34 User-Agent: Notmuch/0.13.2+60~g7ecf77d (http://notmuchmail.org) Emacs/24.1.1\r
35         (x86_64-unknown-linux-gnu)\r
36 Date: Mon, 9 Jul 2012 10:25:48 +0200\r
37 Message-ID: <871ukl5oj7.fsf@cern.ch>\r
38 MIME-Version: 1.0\r
39 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1;\r
40         protocol="application/pgp-signature"\r
41 X-Originating-IP: [134.158.88.68]\r
42 Keywords: CERN SpamKiller Note: -50\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Mon, 09 Jul 2012 08:31:25 -0000\r
56 \r
57 --=-=-=\r
58 Content-Type: text/plain\r
59 \r
60 \r
61 hi there,\r
62 \r
63 I was trying to reduce the I/O stress during my usual email\r
64 fetching+tagging by writing a little program using the go bindings to\r
65 notmuch.\r
66 \r
67 ie:\r
68 db, status := notmuch.OpenDatabase(db_path,\r
69                 notmuch.DATABASE_MODE_READ_WRITE)\r
70 query := db.CreateQuery("(tag:new AND tag:inbox)")\r
71 msgs := query.SearchMessages()\r
72 for _,msg := range msgs {\r
73   tag_msg(msg, tagqueries)\r
74 }\r
75 \r
76 \r
77 where tagqueries is a subquery of the form:\r
78 [\r
79     {\r
80         "Cmd": "+to-me",\r
81         "Query": "(to:sebastien.binet@cern.ch and not tag:to-me)"\r
82     },\r
83     {\r
84         "Cmd": "+sci-notmuch",\r
85         "Query": "from:notmuch@notmuchmail.org or to:notmuch@notmuchmail.org or subject:notmuch"\r
86     }\r
87 ]\r
88 \r
89 \r
90 the idea being that I only need to crawl through the db only once and\r
91 then iteratively apply tags on those messages (instead of repeatedly\r
92 running "notmuch tag ..." for each and every of those many\r
93 'tag-queries')\r
94 \r
95 I couldn't find any C-API to do such a thing using the notmuch library.\r
96 did I overlook something ?\r
97 \r
98 Is it something useful to add ?\r
99 \r
100 -s\r
101 \r
102 --=-=-=\r
103 Content-Type: application/pgp-signature\r
104 \r
105 -----BEGIN PGP SIGNATURE-----\r
106 Version: GnuPG v2.0.19 (GNU/Linux)\r
107 \r
108 iEYEARECAAYFAk/6lZUACgkQPj4AVbsZCCZzDACg2EcoBgFsmozMYmYI/Vj+on6h\r
109 mFYAn19k1GKmhbmAo5MYmthYSf2At5zs\r
110 =d2QK\r
111 -----END PGP SIGNATURE-----\r
112 --=-=-=--\r