sqlite-utils/sqlite_utils/hookspecs.py
Simon Willison c0bcc04431 Automated upgrades by Ruff
uvx --with 'ruff>=0.16.0' ruff check . --fix --unsafe-fixes
2026-07-25 14:20:31 -07:00

17 lines
455 B
Python

import sqlite3
import click
from pluggy import HookimplMarker, HookspecMarker
hookspec = HookspecMarker("sqlite_utils")
hookimpl = HookimplMarker("sqlite_utils")
@hookspec
def register_commands(cli: click.Group) -> None:
"""Register additional CLI commands, e.g. 'sqlite-utils mycommand ...'"""
@hookspec
def prepare_connection(conn: sqlite3.Connection) -> None:
"""Modify SQLite connection in some way e.g. register custom SQL functions"""