[PATCH 9/9] Re: Create LocalStatus or LocalStatusSQLite folders

Nicolas Sebrecht nicolas.s-dev at laposte.net
Wed Apr 27 19:41:41 BST 2011


On Tue, Apr 26, 2011 at 12:31:40PM +0200, Sebastian Spaeth wrote:
> 
> Depending on the configuration we use the plain text or the new
> experimental sqlite backend for the LocalStatus cache. Make plain text
> the default status backend but allow people to configure
> status_backend=sqlite in their [Account ...] section.
> 
> Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
> ---
>  Changelog.draft.rst                   |   12 +++-------
>  offlineimap.conf                      |   12 +++++++++++
>  offlineimap/repository/LocalStatus.py |   36 ++++++++++++++++++++++++++------
>  3 files changed, 45 insertions(+), 15 deletions(-)
> 
> diff --git a/Changelog.draft.rst b/Changelog.draft.rst
> index 0a85888..79f9cd1 100644
> --- a/Changelog.draft.rst
> +++ b/Changelog.draft.rst
> @@ -13,6 +13,10 @@ others.
>  New Features
>  ------------
>  
> +* optional: experimental SQLite-based backend for the LocalStatus
> +  cache. Plain text remains the default. Enable by setting
> +  status_backend=sqlite in the [Account ...] section
> +
>  Changes
>  -------
>  
> @@ -25,11 +29,3 @@ Pending for the next major release
>  
>  * UIs get shorter and nicer names. (API changing)
>  * Implement IDLE feature. (delayed until next major release)
> -
> -
> -Stalled
> -=======
> -
> -* Learn Sqlite support.
> -    Stalled: it would need to learn the ability to choose between the current
> -    format and SQL to help testing the long term.

What a pleasant changelog!

> diff --git a/offlineimap.conf b/offlineimap.conf
> index 7018090..da92a30 100644
> --- a/offlineimap.conf
> +++ b/offlineimap.conf
> @@ -197,6 +197,18 @@ remoterepository = RemoteExample
>  # You can also specify parameters to the commands
>  # presynchook = imapfilter -c someotherconfig.lua
>  
> +# OfflineImap caches the status of your mails to e.g. be able to
> +# determine if a mail has been deleted on one side or added on the
> +# other. The default backend is 'plain' which writes out the status in
> +# plain text files. On Repositories with large numbers of mails, the
> +# performance might not be optimal, as we write out the complete file
> +# for each change. Another backend 'sqlite' is available which stores
> +# the status in sqlite databased. If you switch the backend, you will
> +# have to delete the old cache directory in
> +# ~/.offlineimap/Account-<account>/LocalStatus[-sqlite] manually.
> +
> +status_backend = plain
> +

We have to be much more prudent here, for now. I think about something like:

  OfflineImap caches the state of the synchronisation to e.g. be able to
  determine if a mail has been deleted on one side or added on the other.

  The default and historical backend is 'plain' which writes out the
  state in plain text files. On Repositories with large numbers of mails,
  the performance might not be optimal, as we write out the complete file
  for each change.  Another new backend 'sqlite' is available which stores the
  status in sqlite databases. BE AWARE THIS IS EXPERIMENTAL STUFF.

  If you switch the backend, you may want to delete the old cache
  directory in ~/.offlineimap/Account-<account>/LocalStatus[-sqlite]
  manually.  This is NOT a pre-requisite.

  status_backend = plain

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list