From e1f08a3c1bc1261bd2eaf01c44b0ca6c4659038c Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Sun, 18 Aug 2024 14:47:16 +0100 Subject: [PATCH] Add some documentation for --caching. In the SQLite tutorial, in the section that briefly mentions that automatically downloaded SQLite files are cached in ``.data/oaklib``, we describe in more details how the cache works and how it can be controlled using the `--caching` option. --- docs/intro/tutorial07.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/intro/tutorial07.rst b/docs/intro/tutorial07.rst index 3ebdfb6c6..2d0532ae4 100644 --- a/docs/intro/tutorial07.rst +++ b/docs/intro/tutorial07.rst @@ -64,6 +64,25 @@ This will download the pato.db sqlite file once, and cache it. PyStow is used to cache the file, and the default location is ``~/.data/oaklib``. +By default, a cached SQLite file will be automatically refreshed (downloaded +again) if it is older than 7 days. That behavior can be controlled with the +global ``--caching`` option. For example, to force OAK to always download the +file regardless of its age: + +.. code-block:: + + runoak --caching=refresh -i sqlite:obo:pato search t~shape + +Other possible values for the ``--caching`` option include: + +- ``no-refresh`` to prevent OAK from re-downloading the file even it is older + than 7 days; +- ``Xd`` to refresh a cached file older than _X_ days; +- ``Xw`` to refresh a cached file older than _X_ weeks. + +You may also use the ``cache-clear`` command to force clearing any cached +SQLite file at anytime. + Building your own SQLite files -------------------