- class Database(database_path=':memory:', log_statements=False)¶
Shared meta-information database used by Squirrel.
- dig(nuts, transaction=None)¶
Store or update content meta-information.
nutsare assumed to represent an up-to-date and complete inventory of a set of files. Any old information about these files is first pruned from the database (via database triggers). If such content is part of a live selection, it is also removed there. Then the new content meta-information is inserted into the main database. The content is not automatically inserted into the live selections again. It is in the responsibility of the selection object to perform this step.
Prune content meta-information about a given file.
All content pieces belonging to file
pathare removed from the main database and any attached live selections (via database triggers).
Prune content meta-information about files matching given pattern.
All content pieces belonging to files who’s pathes match the given
patternare removed from the main database and any attached live selections (via database triggers).
- reset(path, transaction=None)¶
Prune information associated with a given file, but keep the file path.
This method is called when reading a file failed. File attributes, format, size and modification time are set to NULL. File content meta-information is removed from the database and any attached live selections (via database triggers).
Update modification time of file without initiating reindexing.
Useful to prolong validity period of data with expiration date.
- class DatabaseStats(**kwargs)¶
Container to hold statistics about contents cached in meta-information db.
- ♦ nfiles¶
Number of files in database.
- ♦ nnuts¶
Number of index nuts in database.
- ♦ codes¶
strobjects objects, default:
Available code sequences in database, e.g. (agency, network, station, location) for stations nuts.
- ♦ kinds¶
Available content types in database.
- ♦ total_size¶
Aggregated file size [bytes] of files referenced in database.
- ♦ counts¶
intobjects objects, default:
Breakdown of how many nuts of any content type and code sequence are available in database,
- ♦ persistent¶
Names of persistent selections stored in database.