Expand description
Implements a hook system, allowing custom logic to be executed at different stages of database interactions. Atmosphere Hook System
This module provides a system for defining and applying hooks at various stages of query execution. Hooks allow for custom logic to be executed at predetermined points in the query lifecycle, such as before binding, before execution, and after execution. This functionality is essential for implementing side effects, validations, or augmentations to the standard query process.
§Concepts
HookStage: An enum representing different stages in the query lifecycle where hooks can be applied.HookInput: An enum representing different types of input that can be provided to hooks.Hook: A trait defining a hook with a specific stage and an application method.Hooks: A trait for associating a set of hooks with a table entity.execute: A function to execute the appropriate hooks for a given stage and context.
The hooks system is a powerful tool for extending and customizing the behavior of database operations, enabling developers to embed additional logic seamlessly within the query execution flow.
Enums§
- Hook
Input - Represents different types of input that can be provided to hooks.
- Hook
Stage - Enumerates different stages in the query lifecycle for hook application.