relstorage.adapters.dbiter

class DatabaseIterator(database_driver)[source]

Bases: relstorage.adapters._util.DatabaseHelpersMixin

Abstract base class for database iteration.

Parameters

database_driver – Necessary to bind queries correctly.

iter_current_records(cursor, start_oid_int=0)[source]

Cause the cursor (which should be a server-side cursor) to execute a query that will iterate over (oid_int, tid_int, state_bytes) values for all the current objects.

Each current object is returned only once, at the transaction most recently committed for it.

Objects are iterated or order of their OID for compatibility with FileStorage.

Returns a generator.

iter_objects(cursor, tid)[source]

Iterate over object states in a transaction.

Yields (oid, state) for each object in the transaction.

class HistoryFreeDatabaseIterator(database_driver)[source]

Bases: relstorage.adapters.dbiter.DatabaseIterator

Parameters

database_driver – Necessary to bind queries correctly.

iter_object_history(cursor, oid)[source]

See IDatabaseIterator

Yields a single row.

iter_transactions(cursor)[source]

This always returns an empty iterable.

iter_transactions_range(cursor, start=None, stop=None)[source]

See IDatabaseIterator.

class HistoryPreservingDatabaseIterator(database_driver)[source]

Bases: relstorage.adapters.dbiter.DatabaseIterator

Parameters

database_driver – Necessary to bind queries correctly.

iter_object_history(cursor, oid)[source]

See IDatabaseIterator Raises KeyError if the object does not exist.

iter_transactions(cursor)[source]

Iterate over the transaction log, newest first.

Skips packed transactions. Yields (tid, username, description, extension) for each transaction.

iter_transactions_range(cursor, start=None, stop=None)[source]

See IDatabaseIterator.