glimr_sqlite/console/command
SQLite Command Support
Provides helpers for creating console commands that need SQLite database access. The handler function wraps your command logic with automatic pool management.
Values
pub fn cache_handler(
cmd: command.Command,
cache_db_handler: fn(
command.ParsedArgs,
pool.Pool,
List(driver.CacheStore),
) -> Nil,
) -> command.Command
Sets a cache handler for a command. Automatically:
- Adds the –database option
- Validates the connection exists and is SQLite
- Starts a typed pool
- Calls your handler with the pool and cache stores
- Stops the pool when done
Your handler receives a fully typed glimr_sqlite.Pool and
the list of cache stores for configuration lookup.
pub fn handler(
cmd: command.Command,
db_handler: fn(command.ParsedArgs, pool.Pool) -> Nil,
) -> command.Command
Sets a database handler for a command. Automatically:
- Adds the –database option
- Validates the connection exists and is SQLite
- Starts a typed pool
- Calls your handler with the pool
- Stops the pool when done
Your handler receives a fully typed glimr_sqlite.Pool.