A storage/query backend for Tokyo Tyrant.
status: | stable |
---|---|
database: | Tokyo Cabinet, Tokyo Tyrant |
dependencies: | Pyrant |
suitable for: | general purpose |
Clears the whole storage from data, resets autoincrement counters.
Connects to the database. Raises RuntimeError if the connection is not closed yet. Use StorageAdapter.reconnect() to explicitly close the connection and open it again.
Permanently deletes the record with given primary key from the database.
Returns document instance for given document class and primary key. Raises KeyError if there is no item with given key in the database.
Returns a list of documents with primary keys from given list. Basically this is just a simple wrapper around get() but some backends can reimplement the method in a much more efficient way.
Queries the database for records associated with given document class and conforming to given extra condtions. If such records exist, picks the first one (the order may be random depending on the database). If there are no such records, creates one.
Returns the document instance and a boolean value “created”.
Gracefully closes current connection (if it’s not broken) and connects again to the database (e.g. reopens the file).
Saves given model instance into the storage. Returns primary key.
Parameters: |
|
---|
Note that you must provide current primary key for a model instance which is already in the database in order to update it instead of copying it.
Returns the number of records that match current query. Does not fetch the records.
Deletes all records that match current query.
Returns a list of unique values for given column name.
Returns Query instance filtered by given conditions.
Returns Query instance. Inverted version of where().