mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-28 21:04:13 +02:00
Tweaks to prepare_connection() example in docs, refs #574
This commit is contained in:
parent
374a816c72
commit
e337a88b45
1 changed files with 1 additions and 2 deletions
|
|
@ -126,13 +126,12 @@ aggregates and collations. For example:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
import click
|
|
||||||
import sqlite_utils
|
import sqlite_utils
|
||||||
|
|
||||||
@sqlite_utils.hookimpl
|
@sqlite_utils.hookimpl
|
||||||
def prepare_connection(conn):
|
def prepare_connection(conn):
|
||||||
conn.create_function(
|
conn.create_function(
|
||||||
"hello", 1, lambda name: f"Hello, {name}!"
|
"hello", 1, lambda name: f"Hello, {name}!"
|
||||||
)
|
)
|
||||||
|
|
||||||
This registers a SQL function called ``hello`` which takes a single
|
This registers a SQL function called ``hello`` which takes a single
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue