Skip to content

Commit

Permalink
Remove pysqlite_ext.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Leifer committed Feb 22, 2017
1 parent d716725 commit add5f2c
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 933 deletions.
52 changes: 0 additions & 52 deletions docs/peewee/playhouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Below you will find a loosely organized listing of the various modules that make
**Database drivers / vendor-specific database functionality**

* :ref:`sqlite_ext`
* :ref:`pysqlite_ext`
* :ref:`sqliteq`
* :ref:`sqlite_udf`
* :ref:`apsw`
Expand Down Expand Up @@ -861,57 +860,6 @@ sqlite_ext API notes
.. note:: For an in-depth discussion of the SQLite transitive closure extension, check out this blog post, `Querying Tree Structures in SQLite using Python and the Transitive Closure Extension <http://charlesleifer.com/blog/querying-tree-structures-in-sqlite-using-python-and-the-transitive-closure-extension/>`_.
.. _pysqlite_ext:
Pysqlite Extension
------------------
The ``playhouse.pysqlite_ext`` module contains a subclass of
:py:class:`SqliteExtDatabase` that exposes several SQLite C APIs. Using the
:py:class:`pysqlite_ext.Database` class, you can:
* create rollback, commit or update hooks
* create deterministic user-defined functions (for optimizing indexes)
* use a smarter busy handler for retrying queries that fail
* access status information, such as cache utilization
For details, see the source at
https://github.com/coleifer/peewee/tree/master/playhouse/pysqlite_ext.pyx
Example usage:
.. code-block:: python
from peewee import *
from playhouse.pysqlite_ext import Database
db = Database(':memory:')
class User(Model):
username = CharField()
class Meta:
database = db
@db.on_update
def update_hook(query_type, db_name, table_name, rowid):
logger.info('%s of row %s on %s.', query_type, rowid, table_name)
@db.func()
def md5(s):
# Function will be deterministic, and can be used in indexes.
return hashlib.md5(s).hexdigest()
@db.func(non_deterministic=True)
def random_int(low, hi):
# Function is non-deterministic.
return random.randint(low, hi)
def print_stats():
print 'Memory used (current, max)', db.memory_used
conn = db.connection
print 'Cache hits for connection', conn.cache_hit
print 'Cache misses for connection', conn.cache_miss
.. _sqliteq:
Expand Down
73 changes: 0 additions & 73 deletions playhouse/_pysqlite/cache.h

This file was deleted.

129 changes: 0 additions & 129 deletions playhouse/_pysqlite/connection.h

This file was deleted.

68 changes: 0 additions & 68 deletions playhouse/_pysqlite/cursor.h

This file was deleted.

58 changes: 0 additions & 58 deletions playhouse/_pysqlite/module.h

This file was deleted.

Loading

0 comments on commit add5f2c

Please sign in to comment.