mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 17:34:32 +02:00
Remove note from docs about 3.8 and deterministic, closes #646
This commit is contained in:
parent
9d7da0606e
commit
532dc4668d
1 changed files with 1 additions and 3 deletions
|
|
@ -2711,7 +2711,7 @@ By default, the name of the Python function will be used as the name of the SQL
|
|||
|
||||
print(db.execute('select rev("hello")').fetchone()[0])
|
||||
|
||||
Python 3.8 added the ability to register `deterministic SQLite functions <https://sqlite.org/deterministic.html>`__, allowing you to indicate that a function will return the exact same result for any given inputs and hence allowing SQLite to apply some performance optimizations. You can mark a function as deterministic using ``deterministic=True``, like this:
|
||||
If a function will return the exact same result for any given inputs you can register it as a `deterministic SQLite function <https://sqlite.org/deterministic.html>`__ allowing SQLite to apply some performance optimizations:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
@ -2719,8 +2719,6 @@ Python 3.8 added the ability to register `deterministic SQLite functions <https:
|
|||
def reverse_string(s):
|
||||
return "".join(reversed(list(s)))
|
||||
|
||||
If you run this on a version of Python prior to 3.8 your code will still work, but the ``deterministic=True`` parameter will be ignored.
|
||||
|
||||
By default registering a function with the same name and number of arguments will have no effect - the ``Database`` instance keeps track of functions that have already been registered and skips registering them if ``@db.register_function`` is called a second time.
|
||||
|
||||
If you want to deliberately replace the registered function with a new implementation, use the ``replace=True`` argument:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue