mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-12 03:24:23 +02:00
17 lines
455 B
Python
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"""
|