hook.database

class immp.hook.database.BaseModel(*args, **kwargs)

Bases: peewee.Model

Template model to be used by other hooks.

class immp.hook.database.DatabaseHook(name, config, host)

Bases: immp.core.hook.ResourceHook

Hook that provides generic database access to other hooks, backed by peewee. Because models are in the global scope, they can only be attached to a single database, therefore this hook acts as the single source of truth for obtaining a “global” database.

db

peewee.Database – Connected database instance.