Skip to content

Commit

Permalink
Add some documentation for --caching.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gouttegd committed Aug 18, 2024
1 parent b1db7b9 commit e1f08a3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/intro/tutorial07.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------------

Expand Down

0 comments on commit e1f08a3

Please sign in to comment.