clusterlib.storage.
sqlite3_dumps
(dictionnary, file_name, timeout=7200.0, overwrite=False)¶Dump value with key in the sqlite3 database.
In order to improve performance, it’s advised to dump into the database as many entry as possible at once. Otherwise by calling this function repeatedly, you might run into the SQlite lock timeout.
Parameters: | dictionnary: dict of (str, object) :
file_name : str
timeout : float, optional (default=7200.0)
overwrite : bool, optional (default=False)
|
---|
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)
...