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, immp.hook.database._ModelsMixin

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.

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

Bases: immp.core.hook.ResourceHook, immp.hook.database._ModelsMixin

Hook that provides generic database access to other hooks, backed by tortoise. 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.