mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 17:34:32 +02:00
sqlite3.enable_callback_tracebacks(True) in docs, closes #300
This commit is contained in:
parent
e83aef951b
commit
ec50e5eebc
1 changed files with 12 additions and 0 deletions
|
|
@ -2323,6 +2323,18 @@ If you want to deliberately replace the registered function with a new implement
|
|||
def reverse_string(s):
|
||||
return s[::-1]
|
||||
|
||||
Exceptions that occur inside a user-defined function default to returning the following error::
|
||||
|
||||
Unexpected error: user-defined function raised exception
|
||||
|
||||
You can cause ``sqlite3`` to return more useful errors, including the traceback from the custom function, by executing the following before your custom fuctions are executed:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from sqlite_utils.utils import sqlite3
|
||||
|
||||
sqlite3.enable_callback_tracebacks(True)
|
||||
|
||||
.. _python_api_quote:
|
||||
|
||||
Quoting strings for use in SQL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue