wuttjamaican.db.handler
¶
Database Handler
- class wuttjamaican.db.handler.DatabaseHandler(config)[source]¶
Base class and default implementation for the db handler.
- next_counter_value(session, key)[source]¶
Return the next counter value for the given key.
If the DB backend is PostgreSQL, then a proper “sequence” is used for the counter.
All other backends use a “fake” sequence by creating a dedicated table with auto-increment primary key, to provide the counter.
- Parameters:
session – Current db session.
key – Unique key indicating the counter for which the next value should be fetched.
- Returns:
Next value as integer.