clusterlib.storage.sqlite3_dumps

clusterlib.storage.sqlite3_dumps(dictionnary, file_name, timeout=7200.0)

Dumps value with key in the sqlite3 database

Parameters:

dictionnary: dict of (str, object) :

Each key is a string associated to an object to store in the database, it will raise an exception if the key is already present in the database.

fname : str

Path to the sqlite database.

timeout : float, optional (default=7200.0)

The timeout parameter specifies how long the connection should wait for the lock to go away until raising an exception.

Examples

Here, we generate a temporary sqlite3 database, then dump some data in it.

>>> from tempfile import NamedTemporaryFile
>>> from clusterlib.storage import sqlite3_dumps
>>> from clusterlib.storage import sqlite3_loads
>>> with NamedTemporaryFile() as fhandle:
...     sqlite3_dumps({"list": [3, 2], "number": 5}, fhandle.name)
...