To minimize memory usage we need to destroy the queries and the
databases, so we should keep track of them.
Each buffer gets a database connection that is destroyed when the buffer
is destroyed, and all the queries along with it.
Ideally notmuch should destroy the queries when the database is
destroyed, but it's not doing that at the moment.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This operation might take a while, and even if it only takes fractions
of a second, that's not what the user might want.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
The old one was not properly maintained and is now deprecated. The new
one has much better support.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>