Skip to content

Commit

Permalink
Removed docs about cominbing pysqlite and apsw. This was experimental…
Browse files Browse the repository at this point in the history
… and I don't want to support it.

Added note about using pysqlite in a multithreaded context.
  • Loading branch information
ghaering committed Aug 6, 2010
1 parent 35f5d46 commit 2be0aea
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions doc/sphinx/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -871,20 +871,16 @@ committed:
.. literalinclude:: ../includes/sqlite3/ctx_manager.py


Combining APSW and pysqlite
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Common issues
-------------

APSW is "Another Python SQLite Wrapper". Its goal is to directly wrap the
SQLite API for Python. If there's SQLite functionality that is only wrapped via
APSW, but not (yet) via pysqlite, then you can still use the APSW functionality
in pysqlite.
Multithreading
^^^^^^^^^^^^^^

Just use the APSW Connection as a parameter to the connect function and reuse
an existing APSW connection like this.
Older SQLite versions had issues with sharing connections between threads.
That's why the Python module disallows sharing connections and cursors between
threads. If you still try to do so, you will get an exception at runtime.

.. literalinclude:: ../includes/sqlite3/apsw_example.py

This feature only works if both APSW and pysqlite are dynamically linked
against the same SQLite shared library. I. e. it will *not* work on Windows
without a custom built pysqlite and APSW.
The only exception is calling the :meth:`~Connection.interrupt` method, which
only makes sense to call from a different thread.

0 comments on commit 2be0aea

Please sign in to comment.