Full Code of coleifer/peewee for AI

master 3abb8c8aaa9d cached
167 files
2.7 MB
725.6k tokens
4557 symbols
1 requests
Download .txt
Showing preview only (2,900K chars total). Download the full file or copy to clipboard to get everything.
Repository: coleifer/peewee
Branch: master
Commit: 3abb8c8aaa9d
Files: 167
Total size: 2.7 MB

Directory structure:
gitextract_2t_sjv5p/

├── .github/
│   └── workflows/
│       ├── tests.yaml
│       └── wheels.yaml
├── .gitignore
├── .readthedocs.yaml
├── .travis.yml
├── .travis_deps.sh
├── CHANGELOG.md
├── LICENSE
├── MANIFEST.in
├── README.rst
├── bench.py
├── docs/
│   ├── Makefile
│   ├── _themes/
│   │   └── flask/
│   │       ├── layout.html
│   │       ├── relations.html
│   │       ├── static/
│   │       │   ├── flasky.css_t
│   │       │   └── small_flask.css
│   │       └── theme.conf
│   ├── clubdata.sql
│   ├── conf.py
│   ├── index.rst
│   ├── make.bat
│   ├── peewee/
│   │   ├── api.rst
│   │   ├── asyncio.rst
│   │   ├── contributing.rst
│   │   ├── database.rst
│   │   ├── db_tools.rst
│   │   ├── example.rst
│   │   ├── framework_integration.rst
│   │   ├── installation.rst
│   │   ├── interactive.rst
│   │   ├── models.rst
│   │   ├── mysql.rst
│   │   ├── orm_utils.rst
│   │   ├── pool-snippet.rst
│   │   ├── postgres.rst
│   │   ├── query_builder.rst
│   │   ├── query_library.rst
│   │   ├── query_operators.rst
│   │   ├── querying.rst
│   │   ├── quickstart.rst
│   │   ├── recipes.rst
│   │   ├── relationships.rst
│   │   ├── schema.rst
│   │   ├── sqlite.rst
│   │   ├── transactions.rst
│   │   └── writing.rst
│   └── requirements.txt
├── examples/
│   ├── adjacency_list.py
│   ├── analytics/
│   │   ├── app.py
│   │   ├── reports.py
│   │   ├── requirements.txt
│   │   └── run_example.py
│   ├── anomaly_detection.py
│   ├── blog/
│   │   ├── app.py
│   │   ├── requirements.txt
│   │   ├── static/
│   │   │   ├── css/
│   │   │   │   └── hilite.css
│   │   │   └── robots.txt
│   │   └── templates/
│   │       ├── base.html
│   │       ├── create.html
│   │       ├── detail.html
│   │       ├── edit.html
│   │       ├── includes/
│   │       │   └── pagination.html
│   │       ├── index.html
│   │       ├── login.html
│   │       └── logout.html
│   ├── diary.py
│   ├── graph.py
│   ├── hexastore.py
│   ├── query_library.py
│   ├── reddit_ranking.py
│   ├── sqlite_fts_compression.py
│   └── twitter/
│       ├── app.py
│       ├── requirements.txt
│       ├── run_example.py
│       ├── static/
│       │   └── style.css
│       └── templates/
│           ├── create.html
│           ├── homepage.html
│           ├── includes/
│           │   ├── message.html
│           │   └── pagination.html
│           ├── join.html
│           ├── layout.html
│           ├── login.html
│           ├── private_messages.html
│           ├── public_messages.html
│           ├── user_detail.html
│           ├── user_followers.html
│           ├── user_following.html
│           └── user_list.html
├── peewee.py
├── playhouse/
│   ├── README.md
│   ├── __init__.py
│   ├── _sqlite_udf.pyx
│   ├── apsw_ext.py
│   ├── cockroachdb.py
│   ├── cysqlite_ext.py
│   ├── dataset.py
│   ├── db_url.py
│   ├── fields.py
│   ├── flask_utils.py
│   ├── hybrid.py
│   ├── kv.py
│   ├── migrate.py
│   ├── mysql_ext.py
│   ├── pool.py
│   ├── postgres_ext.py
│   ├── pwasyncio.py
│   ├── pydantic_utils.py
│   ├── reflection.py
│   ├── shortcuts.py
│   ├── signals.py
│   ├── sqlcipher_ext.py
│   ├── sqlite_changelog.py
│   ├── sqlite_ext.py
│   ├── sqlite_udf.py
│   ├── sqliteq.py
│   └── test_utils.py
├── pwiz.py
├── pyproject.toml
├── runtests.py
├── setup.py
└── tests/
    ├── __init__.py
    ├── __main__.py
    ├── apsw_ext.py
    ├── base.py
    ├── base_models.py
    ├── cockroachdb.py
    ├── cysqlite_ext.py
    ├── dataset.py
    ├── db_tests.py
    ├── db_url.py
    ├── expressions.py
    ├── extra_fields.py
    ├── fields.py
    ├── hybrid.py
    ├── keys.py
    ├── kv.py
    ├── manytomany.py
    ├── migrations.py
    ├── model_save.py
    ├── model_sql.py
    ├── models.py
    ├── mysql_ext.py
    ├── pool.py
    ├── postgres.py
    ├── postgres_helpers.py
    ├── prefetch_tests.py
    ├── pwasyncio.py
    ├── pwasyncio_stress.py
    ├── pwiz_integration.py
    ├── pydantic_utils.py
    ├── queries.py
    ├── reflection.py
    ├── regressions.py
    ├── results.py
    ├── returning.py
    ├── schema.py
    ├── shortcuts.py
    ├── signals.py
    ├── sql.py
    ├── sqlcipher_ext.py
    ├── sqlite.py
    ├── sqlite_changelog.py
    ├── sqlite_helpers.py
    ├── sqlite_udf.py
    ├── sqliteq.py
    ├── test_utils.py
    └── transactions.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/tests.yaml
================================================
name: Tests
on: [push]
jobs:
  tests:
    name: ${{ matrix.peewee-backend }} - ${{ matrix.python-version }}
    runs-on: ubuntu-latest
    timeout-minutes: 15
    services:
      mysql:
        image: mariadb:latest
        env:
          MYSQL_ROOT_PASSWORD: peewee
          MYSQL_DATABASE: peewee_test
        ports:
          - 3306:3306
      postgres:
        image: postgres
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: peewee
          POSTGRES_DB: peewee_test
        ports:
          - 5432:5432
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.9, "3.11", "3.13", "3.14"]
        peewee-backend:
          - "sqlite"
          - "postgresql"
          - "mysql"
        include:
          - python-version: "3.8"
            peewee-backend: sqlite
          - python-version: "3.12"
            peewee-backend: sqlite
          - python-version: "3.12"
            peewee-backend: psycopg3
          - python-version: "3.13"
            peewee-backend: psycopg3
          - python-version: "3.14"
            peewee-backend: psycopg3
          - python-version: "3.13"
            peewee-backend: cysqlite
          - python-version: "3.13"
            peewee-backend: cockroachdb
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
      - name: deps
        env:
          PGUSER: postgres
          PGHOST: 127.0.0.1
          PGPASSWORD: peewee
        run: |
          sudo apt-get install libsqlite3-dev
          pip install setuptools psycopg2-binary cython pymysql 'apsw' mysql-connector sqlcipher3 pysqlite3 'psycopg[binary]' gevent
          pip install greenlet aiosqlite aiomysql asyncpg pydantic
          python setup.py build_ext -i
          psql peewee_test -c 'CREATE EXTENSION hstore;'
      - name: crdb
        if: ${{ matrix.peewee-backend == 'cockroachdb' }}
        run: |
          wget -qO- https://binaries.cockroachdb.com/cockroach-v22.2.6.linux-amd64.tgz | tar xz
          ./cockroach-v22.2.6.linux-amd64/cockroach start-single-node --insecure --background
          ./cockroach-v22.2.6.linux-amd64/cockroach sql --insecure -e 'create database peewee_test;'
      - name: cysqlite
        if: ${{ matrix.peewee-backend == 'cysqlite' || matrix.peewee-backend == 'sqlite' }}
        run: |
          pip install -e 'git+https://github.com/coleifer/cysqlite#egg=cysqlite'
      - name: runtests ${{ matrix.peewee-backend }} - ${{ matrix.python-version }}
        env:
          PEEWEE_TEST_BACKEND: ${{ matrix.peewee-backend }}
          PGUSER: postgres
          PGHOST: 127.0.0.1
          PGPASSWORD: peewee
          CI: 1
        run: python runtests.py --mysql-user=root --mysql-password=peewee -s -v2


================================================
FILE: .github/workflows/wheels.yaml
================================================
name: Build wheels
on:
 push:
   tags:
     - "[0-9]+.[0-9]+.[0-9]+"
     - "[0-9]+.[0-9]+.[0-9]+-**"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Install build tools
        run: |
          python -m pip install -U pip
          pip install setuptools build

      - name: Build sdist and wheel
        env:
          NO_SQLITE: 1
        run: |
          python -m build .

      - uses: actions/upload-artifact@v4
        with:
          name: package
          path: dist/peewee*

  publish:
    needs: [build]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: package
          path: dist
          merge-multiple: true

      - uses: pypa/gh-action-pypi-publish@release/v1
        with:
          user: __token__
          password: ${{ secrets.PYPI_API_TOKEN }}


================================================
FILE: .gitignore
================================================
*.pyc
build
prof/
docs/_build/
playhouse/*.c
playhouse/*.h
playhouse/*.so
playhouse/tests/peewee_test.db
.idea/
MANIFEST
peewee_test.db
closure.so
lsm.so
regexp.so


================================================
FILE: .readthedocs.yaml
================================================
version: 2
python:
  install:
  - requirements: docs/requirements.txt

build:
  os: ubuntu-22.04
  tools:
    python: "3.11"

sphinx:
  configuration: docs/conf.py


================================================
FILE: .travis.yml
================================================
language: python
python:
  - 2.7
  - 3.4
  - 3.5
  - 3.6
env:
  - PEEWEE_TEST_BACKEND=sqlite
  - PEEWEE_TEST_BACKEND=postgresql
  - PEEWEE_TEST_BACKEND=mysql
matrix:
  include:
    - python: 3.7
      dist: xenial
      env: PEEWEE_TEST_BACKEND=sqlite
    - python: 3.7
      dist: xenial
      env: PEEWEE_TEST_BACKEND=postgresql
    - python: 3.7
      dist: xenial
      env: PEEWEE_TEST_BACKEND=mysql
    - python: 3.8
      dist: xenial
    - python: 3.7
      dist: xenial
      env:
      - PEEWEE_TEST_BUILD_SQLITE=1
      - PEEWEE_CLOSURE_EXTENSION=/usr/local/lib/closure.so
      - LSM_EXTENSION=/usr/local/lib/lsm.so
      before_install:
        - sudo apt-get install -y tcl-dev
        - ./.travis_deps.sh
        - sudo ldconfig
      script: "python runtests.py -v2"
    - python: 3.7
      dist: xenial
      env:
      - PEEWEE_TEST_BACKEND=cockroachdb
      before_install:
        - wget -qO- https://binaries.cockroachdb.com/cockroach-v20.1.1.linux-amd64.tgz | tar xvz
        - ./cockroach-v20.1.1.linux-amd64/cockroach start --insecure --background
        - ./cockroach-v20.1.1.linux-amd64/cockroach sql --insecure -e 'create database peewee_test;'
  allow_failures:
addons:
  postgresql: "9.6"
  mariadb: "10.3"
services:
  - postgresql
  - mariadb
install: "pip install psycopg2-binary Cython pymysql apsw mysql-connector"
before_script:
  - python setup.py build_ext -i
  - psql -c 'drop database if exists peewee_test;' -U postgres
  - psql -c 'create database peewee_test;' -U postgres
  - psql peewee_test -c 'create extension hstore;' -U postgres
  - mysql -e 'drop user if exists travis@localhost;'
  - mysql -e 'create user travis@localhost;'
  - mysql -e 'drop database if exists peewee_test;'
  - mysql -e 'create database peewee_test;'
  - mysql -e 'grant all on *.* to travis@localhost;' || true
script: "python runtests.py"


================================================
FILE: .travis_deps.sh
================================================
#!/bin/bash

setup_sqlite_deps() {
  wget https://www.sqlite.org/src/tarball/sqlite.tar.gz
  tar xzf sqlite.tar.gz
  cd sqlite/
  export CFLAGS="-DSQLITE_ENABLE_FTS3 \
    -DSQLITE_ENABLE_FTS3_PARENTHESIS \
    -DSQLITE_ENABLE_FTS4 \
    -DSQLITE_ENABLE_FTS5 \
    -DSQLITE_ENABLE_JSON1 \
    -DSQLITE_ENABLE_LOAD_EXTENSION \
    -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT \
    -DSQLITE_TEMP_STORE=3 \
    -DSQLITE_USE_URI \
    -O2 \
    -fPIC"
  export PREFIX="/usr/local"
  LIBS="-lm" ./configure \
    --disable-tcl \
    --enable-shared \
    --enable-tempstore=always \
    --prefix="$PREFIX"
  make && sudo make install

  cd ext/misc/

  # Build the transitive closure extension and copy shared library.
  gcc -fPIC -O2 -lsqlite3 -shared closure.c -o closure.so
  sudo cp closure.so /usr/local/lib

  # Build the lsm1 extension and copy shared library.
  cd ../lsm1
  export CFLAGS="-fPIC -O2"
  TCCX="gcc -fPIC -O2" make lsm.so
  sudo cp lsm.so /usr/local/lib
}

if [ -n "$PEEWEE_TEST_BUILD_SQLITE" ]; then
  setup_sqlite_deps
fi


================================================
FILE: CHANGELOG.md
================================================
# Changelog

Tracking changes in peewee between versions.  For a complete view of all the
releases, visit GitHub:

https://github.com/coleifer/peewee/releases

## master

[View commits](https://github.com/coleifer/peewee/compare/4.0.2...master)

## 4.0.2

* Remove all Python 2.x compatibility code.
* Add streaming result cursors to pwasyncio module via `db.iterate(query)`.
* Better serialization and deserialization of datetimes and binary data in the
  DataSet module. Previously binary data was encoded as base64, going forward
  hex is the new default. For base64 specify `base64_bytes=True`.
* Improvements to Postgres `BinaryJSONField`, support atomic removal of
  sub-elements, as well as alternate helper for extracting sub-elements and
  querying array length.
* [Pydantic integration](https://docs.peewee-orm.com/en/latest/peewee/orm_utils.html#module-playhouse.pydantic_utils)

[View commits](https://github.com/coleifer/peewee/compare/4.0.1...4.0.2)

## 4.0.1

* Ensure `gr_context` is set on greenlet in `greenlet_spawn` so that
  contextvars will be operable in sync handlers.
* Removed `SqliteExtDatabase` (it basically served no purpose in 4.0). Use
  `SqliteDatabase` instead.
* Moved driver and extension-specific pooled implementations into the
  corresponding extension module rather than putting all into `playhouse.pool`.
* Restore custom `dumps` option for postgres JSON fields.
* Major docs rewrite / reorganization.

[View commits](https://github.com/coleifer/peewee/compare/4.0.0...4.0.1)

## 4.0.0

* Adds preliminary support for `asyncio` via a new playhouse extension. See
  [the documentation](http://docs.peewee-orm.com/en/latest/peewee/asyncio.html)
  for details.
* `PostgresqlDatabase` can use `psycopg` (psycopg3) if it is installed. If both
  psycopg2 and psycopg3 are installed, Peewee will prefer psycopg2, but this
  can be controlled by specifying `prefer_psycopg3=True` in the constructor.
  Same applies to `PostgresqlExtDatabase`.
* `Psycopg3Database` class has been moved to `playhouse.postgres_ext` and is
  now just a thin wrapper around `PostgresqlExtDatabase`.
* Postgres JSON operations no longer dump and try to do minimal casts, instead
  relying on the driver-provided `Json()` wrapper(s).
* Adds new `ISODateTimeField` for Sqlite that encodes datetimes in ISO format
  (more friendly when db is shared with other tools), and also properly reads
  back UTC offset info.
* Remove `playhouse.sqlite_ext.ClosureTable` implementation.
* Add a `Model.dirty_field_names` attribute that is safe for membership
  testing, since testing `x in dirty_fields` returns True if one or more field
  exists due to operator overloads returning a truthy Expression object.
  Refs #3028.
* Removal of Cython `_sqlite_ext` extension. The C implementations of the FTS
  rank functions are moved to `sqlite_udf`. Most of the remaining functionality
  is moved to `playhouse.cysqlite_ext` which supports it natively.

Migrating `CSqliteExtDatabase` usage:

You can either use `sqlite_ext.SqliteExtDatabase` or try the new
`cysqlite_ext.CySqliteDatabase` if you want all the old functionality and are
willing to try a new driver.

[View commits](https://github.com/coleifer/peewee/compare/3.19.0...4.0.0)

## 3.19.0

* Move to new build system using pyproject and github actions.
* No longer build and ship the Sqlite C extensions by default. Users who prefer
  to use those can install via the sdist `pip install peewee --no-binary :all:`.

Rationale about the Sqlite C extensions -- I've started shipping pysqlite3 as a
statically-linked, self-contained binary wheel. This means that when using
Peewee with the statically-linked pysqlite3, you can end up in a funny
situation where the peewee Sqlite extensions are linked against the system
libsqlite3, and the pysqlite driver has it's own Sqlite embedded, which does
not work.

If you are using the system/standard-lib sqlite3 module then the extension
works properly, because everything is talking to the same `libsqlite3`.

Similarly if you built pysqlite3 to link against the system `libsqlite3`
everything also works correctly, though this is not "wheel-friendly".

So in order to use the C extensions, you can install Peewee from the sdist and
do either of the following:

```
# Use system sqlite and standard-lib `sqlite3` module.
$ pip install peewee --no-binary :all:

# OR,
# Use pysqlite3 linked against the system sqlite.
$ pip install pysqlite3 peewee --no-binary :all:
```

I don't believe, besides myself, there were many people using these extensions
so hopefully this change is not disruptive! Please let me hear about it if I'm
mistaken.

Other small changes:

* When exporting / "freezing" binary data with the `playhouse.dataset` JSON
  serializer, encode binary data as base64.

## 3.18.3

* Fix potential regex DoS vulnerability in FTS5 query validation code (#3005).

[View commits](https://github.com/coleifer/peewee/compare/3.18.2...3.18.3)

## 3.18.2

Cython 3.1 removes some Python 2 stuff we referenced -- this resolves the
issue. Couple other very minor fixes.

[View commits](https://github.com/coleifer/peewee/compare/3.18.1...3.18.2)

## 3.18.1

@pypa is such a bunch of clowns. I swear.

![](https://media.charlesleifer.com/blog/photos/p1746027512.1307786.gif)

[View commits](https://github.com/coleifer/peewee/compare/3.18.0...3.18.1)

## 3.18.0

The behavior of `postgresql_ext.BinaryJSONField.contains()` has changed.
Previously, passing a string to this method would perform a JSON key exists
check (`?` operator) instead of JSON contains (`@>` operator). As of 3.18.0,
this special-case has been **removed** and the `contains()` method always uses
the JSONB contains operator (`@>`). For the **old** behavior of checking
whether a key exists, use the `BinaryJSONField.has_key()` method. See #2984 for
discussion.

* Add options to URL-unquote user and password when using the `db_url` helpers,
  see #2974 for discussion.
* Support using `postgresql://` URLs when connecting to psycopg3.

[View commits](https://github.com/coleifer/peewee/compare/3.17.9...3.18.0)

## 3.17.9

* Fix incorrect handling of fk constraint name in migrator.
* Fix test-only issue that can occur in Python 3.14a4.

[View commits](https://github.com/coleifer/peewee/compare/3.17.8...3.17.9)

## 3.17.8

* Fix regression in behavior of `delete_instance()` when traversing nullable
  foreign-keys, #2952. Introduced in 3.17.6. **Recommended that you update**.
* Fix bug where joins not cloned when going from join-less -> joined query,
  refs #2941.

## 3.17.7

* Add db_url support for psycopg3 via `psycopg3://`.
* Ensure double-quotes are escaped properly when introspecting constraints.
* A few documentation-related fixes.

[View commits](https://github.com/coleifer/peewee/compare/3.17.6...3.17.7)

## 3.17.6

* Fix bug in recursive `model.delete_instance()` when a table contains
  foreign-keys at multiple depths of the graph, #2893.
* Fix regression in pool behavior on systems where `time.time()` returns
  identical values for two connections. This adds a no-op comparable sentinel
  to the heap to prevent any recurrence of this problem, #2901.
* Ensure that subqueries inside `CASE` statements generate correct SQL.
* Fix regression that broke server-side cursors with Postgres (introduced in
  3.16.0).
* Fix to ensure compatibility with psycopg3 - the libpq TransactionStatus
  constants are no longer available on the `Connection` instance.
* Fix quoting issue in pwiz that could generate invalid python code for
  double-quoted string literals used as column defaults.

[View commits](https://github.com/coleifer/peewee/compare/3.17.5...3.17.6)

## 3.17.5

This release fixes a build system problem in Python 3.12, #2891.

[View commits](https://github.com/coleifer/peewee/compare/3.17.4...3.17.5)

## 3.17.4

* Fix bug that could occur when using CASE inside a function, and one or more
  of the CASE clauses consisted of a subquery. Refs #2873.
  new fix in #2872 for regression in truthiness of cursor.
* Fix bug in the conversion of TIMESTAMP type in Sqlite on Python 3.12+.
* Fix for hybrid properties on subclasses when aliased (#2888).
* Many fixes for SqliteQueueDatabase (#2874, #2876, #2877).

[View commits](https://github.com/coleifer/peewee/compare/3.17.3...3.17.4)

## 3.17.3

* Better fix for #2871 (extraneous queries when coercing query to list), and

[View commits](https://github.com/coleifer/peewee/compare/3.17.2...3.17.3)

## 3.17.2

* Full support for `psycopg3`.
* Basic support for Sqlite `jsonb`.
* Fix bug where calling `list(query)` resulted in extra queries, #2871

[View commits](https://github.com/coleifer/peewee/compare/3.17.1...3.17.2)

## 3.17.1

* Add bitwise and other helper methods to `BigBitField`, #2802.
* Add `add_column_default` and `drop_column_default` migrator methods for
  specifying a server-side default value, #2803.
* The new `star` attribute was causing issues for users who had a field named
  star on their models. This attribute is now renamed to `__star__`. #2796.
* Fix compatibility issues with 3.12 related to utcnow() deprecation.
* Add stricter locking on connection pool to prevent race conditions.
* Add adapters and converters to Sqlite to replace ones deprecated in 3.12.
* Fix bug in `model_to_dict()` when only aliases are present.
* Fix version check for Sqlite native drop column support.
* Do not specify a `reconnect=` argument to `ping()` if using MySQL 8.x.

[View commits](https://github.com/coleifer/peewee/compare/3.17.0...3.17.1)

## 3.17.0

* Only roll-back in the outermost `@db.transaction` decorator/ctx manager if
  an unhandled exception occurs. Previously, an unhandled exception that
  occurred in a nested `transaction` context would trigger a rollback. The use
  of nested `transaction` has long been discouraged in the documentation: the
  recommendation is to always use `db.atomic`, which will use savepoints to
  properly handle nested blocks. However, the new behavior should make it
  easier to reason about transaction boundaries - see #2767 for discussion.
* Cover transaction `BEGIN` in the reconnect-mixin. Given that no transaction
  has been started, reconnecting when beginning a new transaction ensures that
  a reconnect will occur if it is safe to do so.
* Add support for setting `isolation_level` in `db.atomic()` and
  `db.transaction()` when using Postgres and MySQL/MariaDB, which will apply to
  the wrapped transaction. Note: Sqlite has supported a similar `lock_type`
  parameter for some time.
* Add support for the Sqlite `SQLITE_DETERMINISTIC` function flag. This allows
  user-defined Sqlite functions to be used in indexes and may be used by the
  query planner.
* Fix unreported bug in dataset import when inferred field name differs from
  column name.

[View commits](https://github.com/coleifer/peewee/compare/3.16.3...3.17.0)

## 3.16.3

* Support for Cython 3.0.
* Add flag to `ManyToManyField` to prevent setting/getting values on unsaved
  instances. This is worthwhile, since reading or writing a many-to-many has no
  meaning when the instance is unsaved.
* Adds a `star()` helper to `Source` base-class for selecting all columns.
* Fix missing `binary` types for mysql-connector and mariadb-connector.
* Add `extract()` method to MySQL `JSONField` for extracting a jsonpath.

[View commits](https://github.com/coleifer/peewee/compare/3.16.2...3.16.3)

## 3.16.2

Fixes a longstanding issue with thread-safety of various decorators, including
`atomic()`, `transaction()`, `savepoint()`. The context-managers are
unaffected. See #2709 for details.

[View commits](https://github.com/coleifer/peewee/compare/3.16.1...3.16.2)

## 3.16.1

* Add changes required for building against Cython 3.0 and set Cython
  language-level to 3.
* Ensure indexes aren't added to unindexed fields during introspection, #2691.
* Ensure we don't redundantly select same PK in prefetch when using
  PREFETCH_TYPE.JOIN.
* In Sqlite migrator, use Sqlite's builtin DROP and RENAME column facilities
  when possible. This can be overridden by passing `legacy=True` flag.

[View commits](https://github.com/coleifer/peewee/compare/3.16.0...3.16.1)

## 3.16.0

This release contains backwards-incompatible changes in the way Peewee
initializes connections to the underlying database driver. Previously, peewee
implemented autocommit semantics *on-top* of the existing DB-API transactional
workflow. Going forward, Peewee instead places the DB-API driver into
autocommit mode directly.

Why this change?

Previously, Peewee emulated autocommit behavior for top-level queries issued
outside of a transaction. This necessitated a number of checks which had to be
performed each time a query was executed, so as to ensure that we didn't end up
with uncommitted writes or, conversely, idle read transactions. By running the
underlying driver in autocommit mode, we can eliminate all these checks, since
we are already managing transactions ourselves.

Behaviorally, there should be no change -- Peewee will still treat top-level
queries outside of transactions as being autocommitted, while queries inside of
`atomic()` / `with db:` blocks are implicitly committed at the end of the
block, or rolled-back if an exception occurs.

**How might this affect me?**

* If you are using the underlying database connection or cursors, e.g. via
  `Database.connection()` or `Database.cursor()`, your queries will now be
  executed in autocommit mode.
* The `commit=` argument is deprecated for the `cursor()`, `execute()` and
  `execute_sql()` methods.
* If you have a custom `Database` implementation (whether for a database that
  is not officially supported, or for the purpose of overriding default
  behaviors), you will want to ensure that your connections are opened in
  autocommit mode.

Other changes:

* Some fixes to help with packaging in Python 3.11.
* MySQL `get_columns()` implementation now returns columns in their declared
  order.

[View commits](https://github.com/coleifer/peewee/compare/3.15.4...3.16.0)

## 3.15.4

* Raise an exception in `ReconnectMixin` if connection is lost while inside a
  transaction (if the transaction was interrupted presumably some changes were
  lost and explicit intervention is needed).
* Add `db.Model` property to reduce boilerplate.
* Add support for running `prefetch()` queries with joins instead of subqueries
  (this helps overcome a MySQL limitation about applying LIMITs to a subquery).
* Add SQL `AVG` to whitelist to avoid coercing by default.
* Allow arbitrary keywords in metaclass constructor, #2627
* Add a `pyproject.toml` to silence warnings from newer pips when `wheel`
  package is not available.

This release has a small helper for reducing boilerplate in some cases by
exposing a base model class as an attribute of the database instance.

```python
# old:
db = SqliteDatabase('...')

class BaseModel(Model):
    class Meta:
        database = db

class MyModel(BaseModel):
    pass

# new:
db = SqliteDatabase('...')

class MyModel(db.Model):
    pass
```

[View commits](https://github.com/coleifer/peewee/compare/3.15.3...3.15.4)

## 3.15.3

* Add `scalars()` query method (complements `scalar()`), roughly equivalent to
  writing `[t[0] for t in query.tuples()]`.
* Small doc improvements
* Fix and remove some flaky test assertions with Sqlite INSERT + RETURNING.
* Fix innocuous failing Sqlite test on big-endian machines.

[View commits](https://github.com/coleifer/peewee/compare/3.15.2...3.15.3)

## 3.15.2

* Fix bug where field-specific conversions were being applied to the pattern
  used for LIKE / ILIKE operations. Refs #2609
* Fix possible infinite loop when accidentally invoking the `__iter__` method
  on certain `Column` subclasses. Refs #2606
* Add new helper for specifying which Model a particular selected column-like
  should be bound to, in queries with joins that select from multiple sources.

[View commits](https://github.com/coleifer/peewee/compare/3.15.1...3.15.2)

## 3.15.1

* Fix issue introduced in Sqlite 3.39.0 regarding the propagation of column
  subtypes in subqueries.
* Fix bug where cockroachdb server version was not set when beginning a
  transaction on an unopened database.

[View commits](https://github.com/coleifer/peewee/compare/3.15.0...3.15.1)

## 3.15.0

Rollback behavior change in commit ab43376697 (GH #2026). Peewee will no longer
automatically return the cursor `rowcount` for certain bulk-inserts.  This
should mainly affect users of MySQL and Sqlite who relied on a bulk INSERT
returning the `rowcount` (as opposed to the cursor's `lastrowid`). The
`rowcount` behavior is still available chaining the ``as_rowcount()`` method:

```python
# NOTE: this change only affects MySQL or Sqlite.
db = MySQLDatabase(...)

# Previously, bulk inserts of the following forms would return the rowcount.
query = User.insert_many(...)  # Bulk insert.
query = User.insert_from(...)  # Bulk insert (INSERT INTO .. SELECT FROM).

# Previous behavior (peewee 3.12 - 3.14.10):
# rows_inserted = query.execute()

# New behavior:
last_id = query.execute()

# To get the old behavior back:
rows_inserted = query.as_rowcount().execute()
```

Additionally, in previous versions specifying an empty `.returning()` with
Postgres would cause the rowcount to be returned. For Postgres users who wish
to receive the rowcount:

```python
# NOTE: this change only affects Postgresql.
db = PostgresqlDatabase(...)

# Previously, an empty returning() would return the rowcount.
query = User.insert_many(...)  # Bulk insert.
query = User.insert_from(...)  # Bulk insert (INSERT INTO .. SELECT FROM).

# Old behavior:
# rows_inserted = query.returning().execute()

# To get the rows inserted in 3.15 and newer:
rows_inserted = query.as_rowcount().execute()
```

This release contains a fix for a long-standing request to allow data-modifying
queries to support CTEs. CTEs are now supported for use with INSERT, DELETE and
UPDATE queries - see #2152.

Additionally, this release adds better support for using the new `RETURNING`
syntax with Sqlite automatically. Specify `returning_clause=True` when
initializing your `SqliteDatabase` and all bulk inserts will automatically
specify a `RETURNING` clause, returning the newly-inserted primary keys. This
functionality requires Sqlite 3.35 or newer.

Smaller changes:

* Add `shortcuts.insert_where()` helper for generating conditional INSERT with
  a bit less boilerplate.
* Fix bug in `test_utils.count_queres()` which could erroneously include pool
  events such as connect/disconnect, etc.

[View commits](https://github.com/coleifer/peewee/compare/3.14.10...3.15.0)

## 3.14.10

* Add shortcut for conditional insert using sub-select, see #2528
* Add convenience `left_outer_join()` method to query.
* Add `selected_columns` property to Select queries.
* Add `name` property to Alias instances.
* Fix regression in tests introduced by change to DataSet in 3.14.9.

[View commits](https://github.com/coleifer/peewee/compare/3.14.9...3.14.10)

## 3.14.9

* Allow calling `table_exists()` with a model-class, refs
* Improve `is_connection_usable()` method of `MySQLDatabase` class.
* Better support for VIEWs with `playhouse.dataset.DataSet` and sqlite-web.
* Support INSERT / ON CONFLICT in `playhosue.kv` for newer Sqlite.
* Add `ArrayField.contained_by()` method, a corollary to `contains()` and
  the `contains_any()` methods.
* Support cyclical foreign-key relationships in reflection/introspection, and
  also for sqlite-web.
* Add magic methods for FTS5 field to optimize, rebuild and integrity check the
  full-text index.
* Add fallbacks in `setup.py` in the event distutils is not available.

[View commits](https://github.com/coleifer/peewee/compare/3.14.8...3.14.9)

## 3.14.8

Back-out all changes to automatically use RETURNING for `SqliteExtDatabase`,
`CSqliteExtDatabase` and `APSWDatabase`. The issue I found is that when a
RETURNING cursor is not fully-consumed, any parent SAVEPOINT (and possibly
transaction) would not be able to be released. Since this is a
backwards-incompatible change, I am going to back it out for now.

Returning clause can still be specified for Sqlite, however it just needs to be
done so manually rather than having it applied automatically.

[View commits](https://github.com/coleifer/peewee/compare/3.14.7...3.14.8)

## 3.14.7

Fix bug in APSW extension with Sqlite 3.35 and newer, due to handling of last
insert rowid with RETURNING. Refs #2479.

[View commits](https://github.com/coleifer/peewee/compare/3.14.6...3.14.7)

## 3.14.6

Fix pesky bug in new `last_insert_id()` on the `SqliteExtDatabase`.

[View commits](https://github.com/coleifer/peewee/compare/3.14.5...3.14.6)

## 3.14.5

This release contains a number of bug-fixes and small improvements.

* Only raise `DoesNotExist` when `lazy_load` is enabled on ForeignKeyField,
  fixes issue #2377.
* Add missing convenience method `ModelSelect.get_or_none()`
* Allow `ForeignKeyField` to specify a custom `BackrefAccessorClass`,
  references issue #2391.
* Ensure foreign-key-specific conversions are applied on INSERT and UPDATE,
  fixes #2408.
* Add handling of MySQL error 4031 (inactivity timeout) to the `ReconnectMixin`
  helper class. Fixes #2419.
* Support specification of conflict target for ON CONFLICT/DO NOTHING.
* Add `encoding` parameter to the DataSet `freeze()` and `thaw()` methods,
  fixes #2425.
* Fix bug which prevented `DeferredForeignKey` from being used as a model's
  primary key, fixes #2427.
* Ensure foreign key's related object cache is cleared when the foreign-key is
  set to `None`. Fixes #2428.
* Allow specification of `(schema, table)` to be used with CREATE TABLE AS...,
  fixes #2423.
* Allow reusing open connections with DataSet, refs #2441.
* Add `highlight()` and `snippet()` helpers to Sqlite `SearchField`, for use
  with full-text search extension.
* Preserve user-provided aliases in column names. Fixes #2453.
* Add support for Sqlite 3.37 strict tables.
* Ensure database is inherited when using `ThreadSafeDatabaseMetadata`, and
  also adds an implementation in `playhouse.shortcuts` along with basic unit
  tests.
* Better handling of Model's dirty fields when saving, fixes #2466.
* Add basic support for MariaDB connector driver in `playhouse.mysql_ext`, refs
  issue #2471.
* Begin a basic implementation for a psycopg3-compatible pg database, refs
  issue #2473.
* Add provisional support for RETURNING when using the appropriate versions of
  Sqlite or MariaDB.

[View commits](https://github.com/coleifer/peewee/compare/3.14.4...3.14.5)

## 3.14.4

This release contains an important fix for a regression introduced by commit
ebe3ad5, which affected the way model instances are converted to parameters for
use in expressions within a query. The bug could manifest when code uses model
instances as parameters in expressions against fields that are not
foreign-keys.

The issue is described in #2376.

[View commits](https://github.com/coleifer/peewee/compare/3.14.3...3.14.4)

## 3.14.3

This release contains a single fix for ensuring NULL values are inserted when
issuing a bulk-insert of heterogeneous dictionaries which may be missing
explicit NULL values. Fixes issue #2638.

[View commits](https://github.com/coleifer/peewee/compare/3.14.2...3.14.3)

## 3.14.2

This is a small release mainly to get some fixes out.

* Support for named `Check` and foreign-key constraints.
* Better foreign-key introspection for CockroachDB (and Postgres).
* Register UUID adapter for Postgres.
* Add `fn.array_agg()` to blacklist for automatic value coercion.

[View commits](https://github.com/coleifer/peewee/compare/3.14.1...3.14.2)

## 3.14.1

This release contains primarily bugfixes.

* Properly delegate to a foreign-key field's `db_value()` function when
  converting model instances. #2304.
* Strip quote marks and parentheses from column names returned by sqlite
  cursor when a function-call is projected without an alias. #2305.
* Fix `DataSet.create_index()` method, #2319.
* Fix column-to-model mapping in model-select from subquery with joins, #2320.
* Improvements to foreign-key lazy-loading thanks @conqp, #2328.
* Preserve and handle `CHECK()` constraints in Sqlite migrator, #2343.
* Add `stddev` aggregate function to collection of sqlite user-defined funcs.

[View commits](https://github.com/coleifer/peewee/compare/3.14.0...3.14.1)

## 3.14.0

This release has been a bit overdue and there are numerous small improvements
and bug-fixes. The bugfix that prompted this release is #2293, which is a
regression in the Django-inspired `.filter()` APIs that could cause some
filter expressions to be discarded from the generated SQL. Many thanks for the
excellent bug report, Jakub.

* Add an experimental helper, `shortcuts.resolve_multimodel_query()`, for
  resolving multiple models used in a compound select query.
* Add a `lateral()` method to select query for use with lateral joins, refs
  issue #2205.
* Added support for nested transactions (savepoints) in cockroach-db (requires
  20.1 or newer).
* Automatically escape wildcards passed to string-matching methods, refs #2224.
* Allow index-type to be specified on MySQL, refs #2242.
* Added a new API, `converter()` to be used for specifying a function to use to
  convert a row-value pulled off the cursor, refs #2248.
* Add `set()` and `clear()` method to the bitfield flag descriptor, refs #2257.
* Add support for `range` types with `IN` and other expressions.
* Support CTEs bound to compound select queries, refs #2289.

### Bug-fixes

* Fix to return related object id when accessing via the object-id descriptor,
  when the related object is not populated, refs #2162.
* Fix to ensure we do not insert a NULL value for a primary key.
* Fix to conditionally set the field/column on an added column in a migration,
  refs #2171.
* Apply field conversion logic to model-class values. Relocates the logic from
  issue #2131 and fixes #2185.
* Clone node before modifying it to be flat in an enclosed nodelist expr, fixes
  issue #2200.
* Fix an invalid item assignment in nodelist, refs #2220.
* Fix an incorrect truthiness check used with `save()` and `only=`, refs #2269.
* Fix regression in `filter()` where using both `*args` and `**kwargs` caused
  the expressions passed as `args` to be discarded. See #2293.

[View commits](https://github.com/coleifer/peewee/compare/3.13.3...3.14.0)

## 3.13.3

* Allow arbitrary keyword arguments to be passed to `DataSet` constructor,
  which are then passed to the instrospector.
* Allow scalar subqueries to be compared using numeric operands.
* Fix `bulk_create()` when model being inserted uses FK identifiers.
* Fix `bulk_update()` so that PK values are properly coerced to the right
  data-type (e.g. UUIDs to strings for Sqlite).
* Allow array indices to be used as dict keys, e.g. for the purposes of
  updating a single array index value.

[View commits](https://github.com/coleifer/peewee/compare/3.13.2...3.13.3)

## 3.13.2

* Allow aggregate functions to support an `ORDER BY` clause, via the addition
  of an `order_by()` method to the function (`fn`) instance. Refs #2094.
* Fix `prefetch()` bug, where related "backref" instances were marked as dirty,
  even though they had no changes. Fixes #2091.
* Support `LIMIT 0`. Previously a limit of 0 would be translated into
  effectively an unlimited query on MySQL. References #2084.
* Support indexing into arrays using expressions with Postgres array fields.
  References #2085.
* Ensure postgres introspection methods return the columns for multi-column
  indexes in the correct order. Fixes #2104.
* Add support for arrays of UUIDs to postgres introspection.
* Fix introspection of columns w/capitalized table names in postgres (#2110).
* Fix to ensure correct exception is raised in SqliteQueueDatabase when
  iterating over cursor/result-set.
* Fix bug comparing subquery against a scalar value. Fixes #2118.
* Fix issue resolving composite primary-keys that include foreign-keys when
  building the model-graph. Fixes #2115.
* Allow model-classes to be passed as arguments, e.g., to a table function.
  Refs #2131.
* Ensure postgres `JSONField.concat()` accepts expressions as arguments.

[View commits](https://github.com/coleifer/peewee/compare/3.13.1...3.13.2)

## 3.13.1

Fix a regression when specifying keyword arguments to the `atomic()` or
`transaction()` helper methods. Note: this only occurs if you were using Sqlite
and were explicitly setting the `lock_type=` parameter.

[View commits](https://github.com/coleifer/peewee/compare/3.13.0...3.13.1)

## 3.13.0

### CockroachDB support added

This will be a notable release as it adds support for
[CockroachDB](https://cockroachlabs.com/), a distributed, horizontally-scalable
SQL database.

* [CockroachDB usage overview](http://docs.peewee-orm.com/en/latest/peewee/database.html#using-crdb)
* [CockroachDB API documentation](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#crdb)

### Other features and fixes

* Allow `FOR UPDATE` clause to specify one or more tables (`FOR UPDATE OF...`).
* Support for Postgres `LATERAL` join.
* Properly wrap exceptions raised during explicit commit/rollback in the
  appropriate peewee-specific exception class.
* Capture original exception object and expose it as `exc.orig` on the
  wrapped exception.
* Properly introspect `SMALLINT` columns in Postgres schema reflection.
* More flexible handling of passing database-specific arguments to `atomic()`
  and `transaction()` context-manager/decorator.
* Fix non-deterministic join ordering issue when using the `filter()` API
  across several tables (#2063).

[View commits](https://github.com/coleifer/peewee/compare/3.12.0...3.13.0)

## 3.12.0

* Bulk insert (`insert_many()` and `insert_from()`) will now return the row
  count instead of the last insert ID. If you are using Postgres, peewee will
  continue to return a cursor that provides an iterator over the newly-inserted
  primary-key values by default. This behavior is being retained by default for
  compatibility. Postgres users can simply specify an empty `returning()` call
  to disable the cursor and retrieve the rowcount instead.
* Migration extension now supports altering a column's data-type, via the new
  `alter_column_type()` method.
* Added `Database.is_connection_usabe()` method, which attempts to look at the
  status of the underlying DB-API connection to determine whether the
  connection is usable.
* Common table expressions include a `materialized` parameter, which can be
  used to control Postgres' optimization fencing around CTEs.
* Added `BloomFilter.from_buffer()` method for populating a bloom-filter from
  the output of a previous call to the `to_buffer()` method.
* Fixed APSW extension's `commit()` and `rollback()` methods to no-op if the
  database is in auto-commit mode.
* Added `generate_always=` option to the `IdentityField` (defaults to False).

[View commits](https://github.com/coleifer/peewee/compare/3.11.2...3.12.0)

## 3.11.2

* Implement `hash` interface for `Alias` instances, allowing them to be used in
  multi-source queries.

[View commits](https://github.com/coleifer/peewee/compare/3.11.1...3.11.2)

## 3.11.1

* Fix bug in new `_pk` / `get_id()` implementation for models that explicitly
  have disabled a primary-key.

[View commits](https://github.com/coleifer/peewee/compare/3.11.0...3.11.1)

## 3.11.0

* Fixes #1991. This particular issue involves joining 3 models together in a
  chain, where the outer two models are empty. Previously peewee would make the
  middle model an empty model instance (since a link might be needed from the
  source model to the outermost model). But since both were empty, it is more
  correct to make the intervening model a NULL value on the foreign-key field
  rather than an empty instance.
* An unrelated fix came out of the work on #1991 where hashing a model whose
  primary-key happened to be a foreign-key could trigger the FK resolution
  query. This patch fixes the `Model._pk` and `get_id()` interfaces so they
  no longer introduce the possibility of accidentally resolving the FK.
* Allow `Field.contains()`, `startswith()` and `endswith()` to compare against
  another column-like object or expression.
* Workaround for MySQL prior to 8 and MariaDB handling of union queries inside
  of parenthesized expressions (like IN).
* Be more permissive in letting invalid values be stored in a field whose type
  is INTEGER or REAL, since Sqlite allows this.
* `TimestampField` resolution cleanup. Now values 0 *and* 1 will resolve to a
  timestamp resolution of 1 second. Values 2-6 specify the number of decimal
  places (hundredths to microsecond), or alternatively the resolution can still
  be provided as a power of 10, e.g. 10, 1000 (millisecond), 1e6 (microsecond).
* When self-referential foreign-keys are inherited, the foreign-key on the
  subclass will also be self-referential (rather than pointing to the parent
  model).
* Add TSV import/export option to the `dataset` extension.
* Add item interface to the `dataset.Table` class for doing primary-key lookup,
  assignment, or deletion.
* Extend the mysql `ReconnectMixin` helper to work with mysql-connector.
* Fix mapping of double-precision float in postgres schema reflection.
  Previously it mapped to single-precision, now it correctly uses a double.
* Fix issue where `PostgresqlExtDatabase` and `MySQLConnectorDatabase` did not
  respect the `autoconnect` setting.

[View commits](https://github.com/coleifer/peewee/compare/3.10.0...3.11.0)

## 3.10.0

* Add a helper to `playhouse.mysql_ext` for creating `Match` full-text search
  expressions.
* Added date-part properties to `TimestampField` for accessing the year, month,
  day, etc., within a SQL expression.
* Added `to_timestamp()` helper for `DateField` and `DateTimeField` that
  produces an expression returning a unix timestamp.
* Add `autoconnect` parameter to `Database` classes. This parameter defaults to
  `True` and is compatible with previous versions of Peewee, in which executing
  a query on a closed database would open a connection automatically. To make
  it easier to catch inconsistent use of the database connection, this behavior
  can now be disabled by specifying `autoconnect=False`, making an explicit
  call to `Database.connect()` needed before executing a query.
* Added database-agnostic interface for obtaining a random value.
* Allow `isolation_level` to be specified when initializing a Postgres db.
* Allow hybrid properties to be used on model aliases. Refs #1969.
* Support aggregates with FILTER predicates on the latest Sqlite.

#### Changes

* More aggressively slot row values into the appropriate field when building
  objects from the database cursor (rather than using whatever
  `cursor.description` tells us, which is buggy in older Sqlite).
* Be more permissive in what we accept in the `insert_many()` and `insert()`
  methods.
* When implicitly joining a model with multiple foreign-keys, choose the
  foreign-key whose name matches that of the related model. Previously, this
  would have raised a `ValueError` stating that multiple FKs existed.
* Improved date truncation logic for Sqlite and MySQL to make more compatible
  with Postgres' `date_trunc()` behavior. Previously, truncating a datetime to
  month resolution would return `'2019-08'` for example. As of 3.10.0, the
  Sqlite and MySQL `date_trunc` implementation returns a full datetime, e.g.
  `'2019-08-01 00:00:00'`.
* Apply slightly different logic for casting JSON values with Postgres.
  Previously, Peewee just wrapped the value in the psycopg2 `Json()` helper.
  In this version, Peewee now dumps the json to a string and applies an
  explicit cast to the underlying JSON data-type (e.g. json or jsonb).

#### Bug fixes

* Save hooks can now be called for models without a primary key.
* Fixed bug in the conversion of Python values to JSON when using Postgres.
* Fix for differentiating empty values from NULL values in `model_to_dict`.
* Fixed a bug referencing primary-key values that required some kind of
  conversion (e.g., a UUID). See #1979 for details.
* Add small jitter to the pool connection timestamp to avoid issues when
  multiple connections are checked-out at the same exact time.

[View commits](https://github.com/coleifer/peewee/compare/3.9.6...3.10.0)

## 3.9.6

* Support nesting the `Database` instance as a context-manager. The outermost
  block will handle opening and closing the connection along with wrapping
  everything in a transaction. Nested blocks will use savepoints.
* Add new `session_start()`, `session_commit()` and `session_rollback()`
  interfaces to the Database object to support using transactional controls in
  situations where a context-manager or decorator is awkward.
* Fix error that would arise when attempting to do an empty bulk-insert.
* Set `isolation_level=None` in SQLite connection constructor rather than
  afterwards using the setter.
* Add `create_table()` method to `Select` query to implement `CREATE TABLE AS`.
* Cleanup some declarations in the Sqlite C extension.
* Add new example showing how to implement Reddit's ranking algorithm in SQL.

[View commits](https://github.com/coleifer/peewee/compare/3.9.5...3.9.6)

## 3.9.5

* Added small helper for setting timezone when using Postgres.
* Improved SQL generation for `VALUES` clause.
* Support passing resolution to `TimestampField` as a power-of-10.
* Small improvements to `INSERT` queries when the primary-key is not an
  auto-incrementing integer, but is generated by the database server (eg uuid).
* Cleanups to virtual table implementation and python-to-sqlite value
  conversions.
* Fixed bug related to binding previously-unbound models to a database using a
  context manager, #1913.

[View commits](https://github.com/coleifer/peewee/compare/3.9.4...3.9.5)

## 3.9.4

* Add `Model.bulk_update()` method for bulk-updating fields across multiple
  model instances. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.bulk_update).
* Add `lazy_load` parameter to `ForeignKeyField`. When initialized with
  `lazy_load=False`, the foreign-key will not use an additional query to
  resolve the related model instance. Instead, if the related model instance is
  not available, the underlying FK column value is returned (behaving like the
  "_id" descriptor).
* Added `Model.truncate_table()` method.
* The `reflection` and `pwiz` extensions now attempt to be smarter about
  converting database table and column names into snake-case. To disable this,
  you can set `snake_case=False` when calling the `Introspector.introspect()`
  method or use the `-L` (legacy naming) option with the `pwiz` script.
* Bulk insert via ``insert_many()`` no longer require specification of the
  fields argument when the inserted rows are lists/tuples. In that case, the
  fields will be inferred to be all model fields except any auto-increment id.
* Add `DatabaseProxy`, which implements several of the `Database` class context
  managers. This allows you to reference some of the special features of the
  database object without directly needing to initialize the proxy first.
* Add support for window function frame exclusion and added built-in support
  for the GROUPS frame type.
* Add support for chaining window functions by extending a previously-declared
  window function.
* Playhouse Postgresql extension `TSVectorField.match()` method supports an
  additional argument `plain`, which can be used to control the parsing of the
  TS query.
* Added very minimal `JSONField` to the playhouse MySQL extension.

[View commits](https://github.com/coleifer/peewee/compare/3.9.3...3.9.4)

## 3.9.3

* Added cross-database support for `NULLS FIRST/LAST` when specifying the
  ordering for a query. Previously this was only supported for Postgres. Peewee
  will now generate an equivalent `CASE` statement for Sqlite and MySQL.
* Added [EXCLUDED](http://docs.peewee-orm.com/en/latest/peewee/api.html#EXCLUDED)
  helper for referring to the `EXCLUDED` namespace used with `INSERT...ON CONFLICT`
  queries, when referencing values in the conflicting row data.
* Added helper method to the model `Metadata` class for setting the table name
  at run-time. Setting the `Model._meta.table_name` directly may have appeared
  to work in some situations, but could lead to subtle bugs. The new API is
  `Model._meta.set_table_name()`.
* Enhanced helpers for working with Peewee interactively, [see doc](http://docs.peewee-orm.com/en/latest/peewee/interactive.html).
* Fix cache invalidation bug in `DataSet` that was originally reported on the
  sqlite-web project.
* New example script implementing a [hexastore](https://github.com/coleifer/peewee/blob/master/examples/hexastore.py).

[View commits](https://github.com/coleifer/peewee/compare/3.9.2...3.9.3)

## 3.9.1 and 3.9.2

Includes a bugfix for an `AttributeError` that occurs when using MySQL with the
`MySQLdb` client. The 3.9.2 release includes fixes for a test failure.

[View commits](https://github.com/coleifer/peewee/compare/3.9.0...3.9.2)

## 3.9.0

* Added new document describing how to [use peewee interactively](http://docs.peewee-orm.com/en/latest/peewee/interactive.html).
* Added convenience functions for generating model classes from a pre-existing
  database, printing model definitions and printing CREATE TABLE sql for a
  model. See the "use peewee interactively" section for details.
* Added a `__str__` implementation to all `Query` subclasses which converts the
  query to a string and interpolates the parameters.
* Improvements to `sqlite_ext.JSONField` regarding the serialization of data,
  as well as the addition of options to override the JSON serialization and
  de-serialization functions.
* Added `index_type` parameter to `Field`
* Added `DatabaseProxy`, which allows one to use database-specific decorators
  with an uninitialized `Proxy` object. See #1842 for discussion. Recommend
  that you update any usage of `Proxy` for deferring database initialization to
  use the new `DatabaseProxy` class instead.
* Added support for `INSERT ... ON CONFLICT` when the conflict target is a
  partial index (e.g., contains a `WHERE` clause). The `OnConflict` and
  `on_conflict()` APIs now take an additional `conflict_where` parameter to
  represent the `WHERE` clause of the partial index in question. See #1860.
* Enhanced the `playhouse.kv` extension to use efficient upsert for *all*
  database engines. Previously upsert was only supported for sqlite and mysql.
* Re-added the `orwhere()` query filtering method, which will append the given
  expressions using `OR` instead of `AND`. See #391 for old discussion.
* Added some new examples to the ``examples/`` directory
* Added `select_from()` API for wrapping a query and selecting one or more
  columns from the wrapped subquery. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#SelectQuery.select_from).
* Added documentation on using [row values](http://docs.peewee-orm.com/en/latest/peewee/query_operators.html#row-values).
* Removed the (defunct) "speedups" C extension, which as of 3.8.2 only
  contained a barely-faster function for quoting entities.

**Bugfixes**

* Fix bug in SQL generation when there was a subquery that used a common table
  expressions.
* Enhanced `prefetch()` and fixed bug that could occur when mixing
  self-referential foreign-keys and model aliases.
* MariaDB 10.3.3 introduces backwards-incompatible changes to the SQL used for
  upsert. Peewee now introspects the MySQL server version at connection time to
  ensure proper handling of version-specific features. See #1834 for details.
* Fixed bug where `TimestampField` would treat zero values as `None` when
  reading from the database.

[View commits](https://github.com/coleifer/peewee/compare/3.8.2...3.9.0)

## 3.8.2

**Backwards-incompatible changes**

* The default row-type for `INSERT` queries executed with a non-default
  `RETURNING` clause has changed from `tuple` to `Model` instances. This makes
  `INSERT` behavior consistent with `UPDATE` and `DELETE` queries that specify
  a `RETURNING` clause. To revert back to the old behavior, just append a call
  to `.tuples()` to your `INSERT ... RETURNING` query.
* Removing support for the `table_alias` model `Meta` option. Previously, this
  attribute could be used to specify a "vanity" alias for a model class in the
  generated SQL. As a result of some changes to support more robust UPDATE and
  DELETE queries, supporting this feature will require some re-working. As of
  the 3.8.0 release, it was broken and resulted in incorrect SQL for UPDATE
  queries, so now it is removed.

**New features**

* Added `playhouse.shortcuts.ReconnectMixin`, which can be used to implement
  automatic reconnect under certain error conditions (notably the MySQL error
  2006 - server has gone away).

**Bugfixes**

* Fix SQL generation bug when using an inline window function in the `ORDER BY`
  clause of a query.
* Fix possible zero-division in user-defined implementation of BM25 ranking
  algorithm for SQLite full-text search.

[View commits](https://github.com/coleifer/peewee/compare/3.8.1...3.8.2)

## 3.8.1

**New features**

* Sqlite `SearchField` now supports the `match()` operator, allowing full-text
  search to be performed on a single column (as opposed to the whole table).

**Changes**

* Remove minimum passphrase restrictions in SQLCipher integration.

**Bugfixes**

* Support inheritance of `ManyToManyField` instances.
* Ensure operator overloads are invoked when generating filter expressions.
* Fix incorrect scoring in Sqlite BM25, BM25f and Lucene ranking algorithms.
* Support string field-names in data dictionary when performing an ON CONFLICT
  ... UPDATE query, which allows field-specific conversions to be applied.
  References #1815.

[View commits](https://github.com/coleifer/peewee/compare/3.8.0...3.8.1)

## 3.8.0

**New features**

* Postgres `BinaryJSONField` now supports `has_key()`, `concat()` and
  `remove()` methods (though remove may require pg10+).
* Add `python_value()` method to the SQL-function helper `fn`, to allow
  specifying a custom function for mapping database values to Python values.

**Changes**

* Better support for UPDATE ... FROM queries, and more generally, more robust
  support for UPDATE and RETURNING clauses. This means that the
  `QualifiedNames` helper is no longer needed for certain types of queries.
* The `SqlCipherDatabase` no longer accepts a `kdf_iter` parameter. To
  configure the various SQLCipher encryption settings, specify the setting
  values as `pragmas` when initializing the database.
* Introspection will now, by default, only strip "_id" from introspected column
  names if those columns are foreign-keys. See #1799 for discussion.
* Allow `UUIDField` and `BinaryUUIDField` to accept hexadecimal UUID strings as
  well as raw binary UUID bytestrings (in addition to `UUID` instances, which
  are already supported).
* Allow `ForeignKeyField` to be created without an index.
* Allow multiple calls to `cast()` to be chained (#1795).
* Add logic to ensure foreign-key constraint names that exceed 64 characters
  are truncated using the same logic as is currently in place for long indexes.
* `ManyToManyField` supports foreign-keys to fields other than primary-keys.
* When linked against SQLite 3.26 or newer, support `SQLITE_CONSTRAINT` to
  designate invalid queries against virtual tables.
* SQL-generation changes to aid in supporting using queries within expressions
  following the SELECT statement.

**Bugfixes**

* Fixed bug in `order_by_extend()`, thanks @nhatHero.
* Fixed bug where the `DataSet` CSV import/export did not support non-ASCII
  characters in Python 3.x.
* Fixed bug where `model_to_dict` would attempt to traverse explicitly disabled
  foreign-key backrefs (#1785).
* Fixed bug when attempting to migrate SQLite tables that have a field whose
  column-name begins with "primary_".
* Fixed bug with inheriting deferred foreign-keys.

[View commits](https://github.com/coleifer/peewee/compare/3.7.1...3.8.0)

## 3.7.1

**New features**

* Added `table_settings` model `Meta` option, which should be a list of strings
  specifying additional options for `CREATE TABLE`, which are placed *after*
  the closing parentheses.
* Allow specification of `on_update` and `on_delete` behavior for many-to-many
  relationships when using `ManyToManyField`.

**Bugfixes**

* Fixed incorrect SQL generation for Postgresql ON CONFLICT clause when the
  conflict_target is a named constraint (rather than an index expression). This
  introduces a new keyword-argument to the `on_conflict()` method:
  `conflict_constraint`, which is currently only supported by Postgresql. Refs
  issue #1737.
* Fixed incorrect SQL for sub-selects used on the right side of `IN`
  expressions. Previously the query would be assigned an alias, even though an
  alias was not needed.
* Fixed incorrect SQL generation for Model indexes which contain SQL functions
  as indexed columns.
* Fixed bug in the generation of special queries used to perform operations on
  SQLite FTS5 virtual tables.
* Allow `frozenset` to be correctly parameterized as a list of values.
* Allow multi-value INSERT queries to specify `columns` as a list of strings.
* Support `CROSS JOIN` for model select queries.

[View commits](https://github.com/coleifer/peewee/compare/3.7.0...3.7.1)

## 3.7.0

**Backwards-incompatible changes**

* Pool database `close_all()` method renamed to `close_idle()` to better
  reflect the actual behavior.
* Databases will now raise `InterfaceError` when `connect()` or `close()` are
  called on an uninitialized, deferred database object.

**New features**

* Add methods to the migrations extension to support adding and dropping table
  constraints.
* Add [Model.bulk_create()](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.bulk_create)
  method for bulk-inserting unsaved model instances.
* Add `close_stale()` method to the connection pool to support closing stale
  connections.
* The `FlaskDB` class in `playhouse.flask_utils` now accepts a `model_class`
  parameter, which can be used to specify a custom base-class for models.

**Bugfixes**

* Parentheses were not added to subqueries used in function calls with more
  than one argument.
* Fixed bug when attempting to serialize many-to-many fields which were created
  initially with a `DeferredThroughModel`, see #1708.
* Fixed bug when using the Postgres `ArrayField` with an array of `BlobField`.
* Allow `Proxy` databases to be used as a context-manager.
* Fixed bug where the APSW driver was referring to the SQLite version from the
  standard library `sqlite3` driver, rather than from `apsw`.
* Reflection library attempts to wrap server-side column defaults in quotation
  marks if the column data-type is text/varchar.
* Missing import in migrations library, which would cause errors when
  attempting to add indexes whose name exceeded 64 chars.
* When using the Postgres connection pool, ensure any open/pending transactions
  are rolled-back when the connection is recycled.
* Even *more* changes to the `setup.py` script. In this case I've added a
  helper function which will reliably determine if the SQLite3 extensions can
  be built. This follows the approach taken by the Python YAML package.

[View commits](https://github.com/coleifer/peewee/compare/3.6.4...3.7.0)

## 3.6.4

Take a whole new approach, following what `simplejson` does. Allow the
`build_ext` command class to fail, and retry without extensions in the event we
run into issues building extensions. References #1676.

[View commits](https://github.com/coleifer/peewee/compare/3.6.3...3.6.4)

## 3.6.3

Add check in `setup.py` to determine if a C compiler is available before
building C extensions. References #1676.

[View commits](https://github.com/coleifer/peewee/compare/3.6.2...3.6.3)

## 3.6.2

Use `ctypes.util.find_library` to determine if `libsqlite3` is installed.
Should fix problems people are encountering installing when SQLite3 is not
available.

[View commits](https://github.com/coleifer/peewee/compare/3.6.1...3.6.2)

## 3.6.1

Fixed issue with setup script.

[View commits](https://github.com/coleifer/peewee/compare/3.6.0...3.6.1)

## 3.6.0

* Support for Python 3.7, including bugfixes related to new StopIteration
  handling inside of generators.
* Support for specifying `ROWS` or `RANGE` window frame types. For more
  information, see the new [frame type documentation](http://docs.peewee-orm.com/en/latest/peewee/querying.html#frame-types-range-vs-rows).
* Add APIs for user-defined window functions if using [pysqlite3](https://github.com/coleifer/pysqlite3)
  and sqlite 3.25.0 or newer.
* `TimestampField` now uses 64-bit integer data-type for storage.
* Added support to `pwiz` and `playhouse.reflection` to enable generating
  models from VIEWs.
* Added lower-level database API for introspecting VIEWs.
* Revamped continuous integration setup for better coverage, including 3.7 and
  3.8-dev.
* Allow building C extensions even if Cython is not installed, by distributing
  pre-generated C source files.
* Switch to using `setuptools` for packaging.

[View commits](https://github.com/coleifer/peewee/compare/3.5.2...3.6.0)

## 3.5.2

* New guide to using [window functions in Peewee](http://docs.peewee-orm.com/en/latest/peewee/querying.html#window-functions).
* New and improved table name auto-generation. This feature is not backwards
  compatible, so it is **disabled by default**. To enable, set
  `legacy_table_names=False` in your model's `Meta` options. For more details,
  see [table names](http://docs.peewee-orm.com/en/latest/peewee/models.html#table_names)
  documentation.
* Allow passing single fields/columns to window function `order_by` and
  `partition_by` arguments.
* Support for `FILTER (WHERE...)` clauses with window functions and aggregates.
* Added `IdentityField` class suitable for use with Postgres 10's new identity
  column type. It can be used anywhere `AutoField` or `BigAutoField` was being
  used previously.
* Fixed bug creating indexes on tables that are in attached databases (SQLite).
* Fixed obscure bug when using `prefetch()` and `ModelAlias` to populate a
  back-reference related model.

[View commits](https://github.com/coleifer/peewee/compare/3.5.1...3.5.2)

## 3.5.1

**New features**

* New documentation for working with [relationships](http://docs.peewee-orm.com/en/latest/peewee/relationships.html)
  in Peewee.
* Improved tests and documentation for MySQL upsert functionality.
* Allow `database` parameter to be specified with `ModelSelect.get()` method.
  For discussion, see #1620.
* Add `QualifiedNames` helper to peewee module exports.
* Add `temporary=` meta option to support temporary tables.
* Allow a `Database` object to be passed to constructor of `DataSet` helper.

**Bug fixes**

* Fixed edge-case where attempting to alias a field to it's underlying
  column-name (when different), Peewee would not respect the alias and use the
  field name instead. See #1625 for details and discussion.
* Raise a `ValueError` when joining and aliasing the join to a foreign-key's
  `object_id_name` descriptor. Should prevent accidentally introducing O(n)
  queries or silently ignoring data from a joined-instance.
* Fixed bug for MySQL when creating a foreign-key to a model which used the
  `BigAutoField` for it's primary-key.
* Fixed bugs in the implementation of user-defined aggregates and extensions
  with the APSW SQLite driver.
* Fixed regression introduced in 3.5.0 which ignored custom Model `__repr__()`.
* Fixed regression from 2.x in which inserting from a query using a `SQL()` was
  no longer working. Refs #1645.

[View commits](https://github.com/coleifer/peewee/compare/3.5.0...3.5.1)

## 3.5.0

**Backwards-incompatible changes**

* Custom Model `repr` no longer use the convention of overriding `__unicode__`,
  and now use `__str__`.
* Redesigned the [sqlite json1 integration](http://docs.peewee-orm.com/en/latest/peewee/sqlite_ext.html#sqlite-json1).
  and changed some of the APIs and semantics of various `JSONField` methods.
  The documentation has been expanded to include more examples and the API has
  been simplified to make it easier to work with. These changes **do not** have
  any effect on the [Postgresql JSON fields](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pgjson).

**New features**

* Better default `repr` for model classes and fields.
* `ForeignKeyField()` accepts a new initialization parameter, `deferrable`, for
  specifying when constraints should be enforced.
* `BitField.flag()` can be called without a value parameter for the common
  use-case of using flags that are powers-of-2.
* `SqliteDatabase` pragmas can be specified as a `dict` (previously required a
  list of 2-tuples).
* SQLite `TableFunction` ([docs](http://docs.peewee-orm.com/en/latest/peewee/sqlite_ext.html#sqlite-vtfunc))
  will print Python exception tracebacks raised in the `initialize` and
  `iterate` callbacks, making debugging significantly easier.

**Bug fixes**

* Fixed bug in `migrator.add_column()` where, if the field being added declared
  a non-standard index type (e.g., binary json field with GIN index), this
  index type was not being respected.
* Fixed bug in `database.table_exists()` where the implementation did not match
  the documentation. Implementation has been updated to match the
  documentation.
* Fixed bug in SQLite `TableFunction` implementation which raised errors if the
  return value of the `iterate()` method was not a `tuple`.

[View commits](https://github.com/coleifer/peewee/compare/3.4.0...3.5.0)

## 3.4.0

**Backwards-incompatible changes**

* The `regexp()` operation is now case-sensitive for MySQL and Postgres. To
  perform case-insensitive regexp operations, use `iregexp()`.
* The SQLite `BareField()` field-type now supports all column constraints
  *except* specifying the data-type. Previously it silently ignored any column
  constraints.
* LIMIT and OFFSET parameters are now treated as parameterized values instead
  of literals.
* The `schema` parameter for SQLite database introspection methods is no longer
  ignored by default. The schema corresponds to the name given to an attached
  database.
* `ArrayField` now accepts a new parameter `field_kwargs`, which is used to
  pass information to the array field's `field_class` initializer.

**New features and other changes**

* SQLite backup interface supports specifying page-counts and a user-defined
  progress handler.
* GIL is released when doing backups or during SQLite busy timeouts (when using
  the peewee SQLite busy-handler).
* Add NATURAL join-type to the `JOIN` helper.
* Improved identifier quoting to allow specifying distinct open/close-quote
  characters. Enables adding support for MSSQL, for instance, which uses square
  brackets, e.g. `[table].[column]`.
* Unify timeout interfaces for SQLite databases (use seconds everywhere rather
  than mixing seconds and milliseconds, which was confusing).
* Added `attach()` and `detach()` methods to SQLite database, making it
  possible to attach additional databases (e.g. an in-memory cache db).

[View commits](https://github.com/coleifer/peewee/compare/3.3.4...3.4.0)

## 3.3.4

* Added a `BinaryUUIDField` class for efficiently storing UUIDs in 16-bytes.
* Fix dataset's `update_cache()` logic so that when updating a single table
  that was newly-added, we also ensure that all dependent tables are updated at
  the same time. Refs coleifer/sqlite-web#42.

[View commits](https://github.com/coleifer/peewee/compare/3.3.3...3.3.4)

## 3.3.3

* More efficient implementation of model dependency-graph generation. Improves
  performance of recursively deleting related objects by omitting unnecessary
  subqueries.
* Added `union()`, `union_all()`, `intersect()` and `except_()` to the
  `Model`-specific query implementations. This was an oversight that should
  have been patched in 3.3.2, but is fixed in 3.3.3.
* Major cleanup to test runner and standardized test skipping logic to
  integrate with standard-library `unittest` conventions.

[View commits](https://github.com/coleifer/peewee/compare/3.3.2...3.3.3)

## 3.3.2

* Add methods for `union()`, `union_all`, `intersect()` and `except_()`.
  Previously, these methods were only available as operator overloads.
* Removed some Python 2.6-specific support code, as 2.6 is no longer officially
  supported.
* Fixed model-graph resolution logic for deferred foreign-keys.
* Better support for UPDATE...FROM queries (Postgresql).

[View commits](https://github.com/coleifer/peewee/compare/3.3.1...3.3.2)

## 3.3.1

* Fixed long-standing bug in 3.x regarding using column aliases with queries
  that utilize the ModelCursorWrapper (typically queries with one or more
  joins).
* Fix typo in model metadata code, thanks @klen.
* Add examples of using recursive CTEs to docs.

[View commits](https://github.com/coleifer/peewee/compare/3.3.0...3.3.1)

## 3.3.0

* Added support for SQLite's new `ON CONFLICT` clause, which is modelled on the
  syntax used by Postgresql and will be available in SQLite 3.24.0 and onward.
* Added better support for using common table expressions and a cleaner way of
  implementing recursive CTEs, both of which are also tested with integration
  tests (as opposed to just checking the generated SQL).
* Modernized the CI environment to utilize the latest MariaDB features, so we
  can test window functions and CTEs with MySQL (when available).
* Reorganized and unified the feature-flags in the test suite.

[View commits](https://github.com/coleifer/peewee/compare/3.2.5...3.3.0)

## 3.2.5

* Added `ValuesList` for representing values lists. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#ValuesList).
* `DateTimeField`, `DateField` and `TimeField` will parse formatted-strings
  before sending to the database. Previously this only occurred when reading
  values from the database.

[View commits](https://github.com/coleifer/peewee/compare/3.2.4...3.2.5)

## 3.2.4

* Smarter handling of model-graph when dealing with compound queries (union,
  intersect, etc). #1579.
* If the same column-name is selected multiple times, first value wins. #1579.
* If `ModelSelect.switch()` is called without any arguments, default to the
  query's model. Refs #1573.
* Fix issue where cloning a ModelSelect query did not result in the joins being
  cloned. #1576.

[View commits](https://github.com/coleifer/peewee/compare/3.2.3...3.2.4)

## 3.2.3

* `pwiz` tool will capture column defaults defined as part of the table schema.
* Fixed a misleading error message - #1563.
* Ensure `reuse_if_open` parameter has effect on pooled databases.
* Added support for on update/delete when migrating foreign-key.
* Fixed bug in SQL generation for subqueries in aliased functions #1572.

[View commits](https://github.com/coleifer/peewee/compare/3.2.2...3.2.3)

## 3.2.2

* Added support for passing `Model` classes to the `returning()` method when
  you intend to return all columns for the given model.
* Fixed a bug when using user-defined sequences, and the underlying sequence
  already exists.
* Added `drop_sequences` parameter to `drop_table()` method which allows you to
  conditionally drop any user-defined sequences when dropping the table.

[View commits](https://github.com/coleifer/peewee/compare/3.2.1...3.2.2)

## 3.2.1

**Notice:** the default mysql driver for Peewee has changed to [pymysql](https://github.com/PyMySQL/PyMySQL)
in version 3.2.1. In previous versions, if both *mysql-python* and *pymysql*
were installed, Peewee would use *mysql-python*. As of 3.2.1, if both libraries
are installed Peewee will use *pymysql*.

* Added new module `playhouse.mysql_ext` which includes
  `MySQLConnectorDatabase`, a database implementation that works with the
  [mysql-connector](https://dev.mysql.com/doc/connector-python/en/) driver.
* Added new field to `ColumnMetadata` class which captures a database column's
  default value. `ColumnMetadata` is returned by `Database.get_columns()`.
* Added [documentation on making Peewee async](http://docs.peewee-orm.com/en/latest/peewee/database.html#async-with-gevent).

[View commits](https://github.com/coleifer/peewee/compare/3.2.0...3.2.1)

## 3.2.0

The 3.2.0 release introduces a potentially backwards-incompatible change. The
only users affected will be those that have implemented custom `Field` types
with a user-defined `coerce` method. tl/dr: rename the coerce attribute to
adapt and you should be set.

#### Field.coerce renamed to Field.adapt

The `Field.coerce` method has been renamed to `Field.adapt`. The purpose of
this method is to convert a value from the application/database into the
appropriate Python data-type. For instance, `IntegerField.adapt` is simply the
`int` built-in function.

The motivation for this change is to support adding metadata to any AST node
instructing Peewee to not coerce the associated value. As an example, consider
this code:

```python

class Note(Model):
    id = AutoField()  # autoincrementing integer primary key.
    content = TextField()

# Query notes table and cast the "id" to a string and store as "id_text" attr.
query = Note.select(Note.id.cast('TEXT').alias('id_text'), Note.content)

a_note = query.get()
print((a_note.id_text, a_note.content))

# Prior to 3.2.0 the CAST is "un-done" because the value gets converted
# back to an integer, since the value is associated with the Note.id field:
(1, u'some note')  # 3.1.7, e.g. -- "id_text" is an integer!

# As of 3.2.0, CAST will automatically prevent the conversion of field values,
# which is an extension of a more general metadata API that can instruct Peewee
# not to convert certain values.
(u'1', u'some note')  # 3.2.0 -- "id_text" is a string as expected.
```

If you have implemented custom `Field` classes and are using `coerce` to
enforce a particular data-type, you can simply rename the attribute to `adapt`.

#### Other changes

Old versions of SQLite do not strip quotation marks from aliased column names
in compound queries (e.g. UNION). Fixed in 3.2.0.

[View commits](https://github.com/coleifer/peewee/compare/3.1.7...3.2.0)

## 3.1.7

For all the winblows lusers out there, added an option to skip compilation of
the SQLite C extensions during installation. Set env var `NO_SQLITE=1` and run
`setup.py install` and you should be able to build without requiring SQLite.

[View commits](https://github.com/coleifer/peewee/compare/3.1.6...3.1.7)

## 3.1.6

* Added `rekey()` method to SqlCipher database for changing encryption key and
  documentation for `set_passphrase()` method.
* Added `convert_values` parameter to `ArrayField` constructor, which will
  cause the array values to be processed using the underlying data-type's
  conversion logic.
* Fixed unreported bug using `TimestampField` with sub-second resolutions.
* Fixed bug where options were not being processed when calling `drop_table()`.
* Some fixes and improvements to `signals` extension.

[View commits](https://github.com/coleifer/peewee/compare/3.1.5...3.1.6)

## 3.1.5

Fixed Python 2/3 incompatibility with `itertools.izip_longest()`.

[View commits](https://github.com/coleifer/peewee/compare/3.1.4...3.1.5)

## 3.1.4

* Added `BigAutoField` to support 64-bit auto-incrementing primary keys.
* Use Peewee-compatible datetime serialization when exporting JSON from
  a `DataSet`. Previously the JSON export used ISO-8601 by default. See #1536.
* Added `Database.batch_commit` helper to wrap iterators in chunked
  transactions. See #1539 for discussion.

[View commits](https://github.com/coleifer/peewee/compare/3.1.3...3.1.4)

## 3.1.3

* Fixed issue where scope-specific settings were being updated in-place instead
  of copied. #1534.
* Fixed bug where setting a `ForeignKeyField` did not add it to the model's
  "dirty" fields list. #1530.
* Use pre-fetched data when using `prefetch()` with `ManyToManyField`. Thanks
  to @iBelieve for the patch. #1531.
* Use `JSON` data-type for SQLite `JSONField` instances.
* Add a `json_contains` function for use with SQLite `json1` extension.
* Various documentation updates and additions.

[View commits](https://github.com/coleifer/peewee/compare/3.1.2...3.1.3)

## 3.1.2

#### New behavior for INSERT queries with RETURNING clause

Investigating #1522, it occurred to me that INSERT queries with non-default
*RETURNING* clauses (postgres-only feature) should always return a cursor
object. Previously, if executing a single-row INSERT query, the last-inserted
row ID would be returned, regardless of what was specified by the RETURNING
clause.

This change only affects INSERT queries with non-default RETURNING clauses and
will cause a cursor to be returned, as opposed to the last-inserted row ID.

[View commits](https://github.com/coleifer/peewee/compare/3.1.1...3.1.2)

## 3.1.1

* Fixed bug when using `Model.alias()` when the model defined a particular
  database schema.
* Added `SchemaManager.create_foreign_key` API to simplify adding constraints
  when dealing with circular foreign-key relationships. Updated docs
  accordingly.
* Improved implementation of `Migrator.add_foreign_key_constraint` so that it
  can be used with Postgresql (in addition to MySQL).
* Added `PickleField` to the `playhouse.fields` module. [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#PickleField).
* Fixed bug in implementation of `CompressedField` when using Python 3.
* Added `KeyValue` API in `playhouse.kv` module. [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#key-value-store).
* More test cases for joining on sub-selects or common table expressions.

[View commits](https://github.com/coleifer/peewee/compare/3.1.0...3.1.1)

## 3.1.0

#### Backwards-incompatible changes

`Database.bind()` has been renamed to `Database.bind_ctx()`, to more closely
match the semantics of the corresponding model methods, `Model.bind()` and
`Model.bind_ctx()`. The new `Database.bind()` method is a one-time operation
that binds the given models to the database. See documentation:

* [Database.bind()](http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.bind)
* [Database.bind_ctx()](http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.bind_ctx)

#### Other changes

* Removed Python 2.6 support code from a few places.
* Fixed example analytics app code to ensure hstore extension is registered.
* Small efficiency improvement to bloom filter.
* Removed "attention!" from *README*.

[View commits](https://github.com/coleifer/peewee/compare/3.0.20...3.1.0)

## 3.0.20

* Include `schema` (if specified) when checking for table-existence.
* Correct placement of ORDER BY / LIMIT clauses in compound select queries.
* Fix bug in back-reference lookups when using `filter()` API.
* Fix bug in SQL generation for ON CONFLICT queries with Postgres, #1512.

[View commits](https://github.com/coleifer/peewee/compare/3.0.19...3.0.20)

## 3.0.19

* Support for more types of mappings in `insert_many()`, refs #1495.
* Lots of documentation improvements.
* Fix bug when calling `tuples()` on a `ModelRaw` query. This was reported
  originally as a bug with *sqlite-web* CSV export. See coleifer/sqlite-web#38.

[View commits](https://github.com/coleifer/peewee/compare/3.0.18...3.0.19)

## 3.0.18

* Improved error messages when attempting to use a database class for which the
  corresponding driver is not installed.
* Added tests showing the use of custom operator (a-la the docs).
* Fixed indentation issue in docs, #1493.
* Fixed issue with the SQLite date_part issue, #1494.

[View commits](https://github.com/coleifer/peewee/compare/3.0.17...3.0.18)

## 3.0.17

* Fix `schema` inheritance regression, #1485.
* Add helper method to postgres migrator for setting search_path, #1353.

[View commits](https://github.com/coleifer/peewee/compare/3.0.16...3.0.17)

## 3.0.16

* Improve model graph resolution when iterating results of a query. Refs #1482.
* Allow Model._meta.schema to be changed at run-time. #1483.

[View commits](https://github.com/coleifer/peewee/compare/3.0.15...3.0.16)

## 3.0.15

* Use same `schema` used for reflection in generated models.
* Preserve `pragmas` set on deferred Sqlite database if database is
  re-initialized without re-specifying pragmas.

[View commits](https://github.com/coleifer/peewee/compare/3.0.14...3.0.15)

## 3.0.14

* Fix bug creating model instances on Postgres when model does not have a
  primary key column.
* Extend postgresql reflection to support array types.

[View commits](https://github.com/coleifer/peewee/compare/3.0.13...3.0.14)

## 3.0.13

* Fix bug where simple field aliases were being ignored. Fixes #1473.
* More strict about column type inference for postgres + pwiz.

[View commits](https://github.com/coleifer/peewee/compare/3.0.12...3.0.13)

## 3.0.12

* Fix queries of the form INSERT ... VALUES (SELECT...) so that sub-select is
  wrapped in parentheses.
* Improve model-graph resolution when selecting from multiple tables that are
  joined by foreign-keys, and an intermediate table is omitted from selection.
* Docs update to reflect deletion of post_init signal.

[View commits](https://github.com/coleifer/peewee/compare/3.0.11...3.0.12)

## 3.0.11

* Add note to changelog about `cursor()` method.
* Add hash method to postgres indexedfield subclasses.
* Add TableFunction to sqlite_ext module namespace.
* Fix bug regarding NOT IN queries where the right-hand-side is an empty set.
* Fallback implementations of bm25f and lucene search ranking algorithms.
* Fixed DecimalField issue.
* Fixed issue with BlobField when database is a Proxy object.

[View commits](https://github.com/coleifer/peewee/compare/3.0.10...3.0.11)

## 3.0.10

* Fix `Database.drop_tables()` signature to support `cascade` argument - #1453.
* Fix querying documentation for custom functions - #1454.
* Added len() method to `ModelBase` for convenient counting.
* Fix bug related to unsaved relation population (thanks @conqp) - #1459.
* Fix count() on compound select - #1460.
* Support `coerce` keyword argument with `fn.XXX()` - #1463.
* Support updating existing model instance with dict_to_model-like API - #1456.
* Fix equality tests with ArrayField - #1461.

[View commits](https://github.com/coleifer/peewee/compare/3.0.9...3.0.10)

## 3.0.9

* Add deprecation notice if passing `autocommit` as keyword argument to the
  `Database` initializer. Refs #1452.
* Add `JSONPath` and "J" helpers to sqlite extension.

[View commits](https://github.com/coleifer/peewee/compare/3.0.8...3.0.9)

## 3.0.8

* Add support for passing `cascade=True` when dropping tables. Fixes #1449.
* Fix issues with backrefs and inherited foreign-keys. Fixes #1448.

[View commits](https://github.com/coleifer/peewee/compare/3.0.7...3.0.8)

## 3.0.7

* Add `select_extend()` method to extend existing SELECT-ion. [Doc](http://docs.peewee-orm.com/en/latest/peewee/api.html#Select.select_extend).
* Accept `set()` as iterable value type, fixes #1445
* Add test for model/field inheritance and fix bug relating to recursion error
  when inheriting foreign-key field. Fixes #1448.
* Fix regression where consecutive calls to `ModelSelect.select()` with no
  parameters resulted in an empty selection. Fixes #1438.

[View commits](https://github.com/coleifer/peewee/compare/3.0.6...3.0.7)

## 3.0.6

Add constraints for ON UPDATE/ON DELETE to foreign-key constraint - #1443.

[View commits](https://github.com/coleifer/peewee/compare/3.0.5...3.0.6)

## 3.0.5

Adds Model.index(), a short-hand method for declaring ModelIndex instances.

* [Model.index docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.index)
* [Model.add_index docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.add_index)
* [ModelIndex docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#ModelIndex)

[View commits](https://github.com/coleifer/peewee/compare/3.0.4...3.0.5)

## 3.0.4

Re-add a shim for `PrimaryKeyField` (renamed to `AutoField`) and log a
deprecation warning if you try to use it.

[View commits](https://github.com/coleifer/peewee/compare/3.0.3...3.0.4)

## 3.0.3

Includes fix for bug where column-name to field-name translation was not being
done when running select queries on models whose field name differed from the
underlying column name (#1437).

[View commits](https://github.com/coleifer/peewee/compare/3.0.2...3.0.3)

## 3.0.2

Ensures that the pysqlite headers are included in the source distribution so
that certain C extensions can be compiled.

[View commits](https://github.com/coleifer/peewee/compare/3.0.0...3.0.2)

## 3.0.0

* Complete rewrite of SQL AST and code-generation.
* Inclusion of new, low-level query builder APIs.
* List of [backwards-incompatible changes](http://docs.peewee-orm.com/en/latest/peewee/changes.html).

[View commits](https://github.com/coleifer/peewee/compare/2.10.2...3.0.0)

## 2.10.2

* Update travis-ci build scripts to use Postgres 9.6 and test against Python
  3.6.
* Added support for returning `namedtuple` objects when iterating over a
  cursor.
* Added support for specifying the "object id" attribute used when declaring a
  foreign key. By default, it is `foreign-key-name_id`, but it can now be
  customized.
* Fixed small bug in the calculation of search scores when using the SQLite C
  extension or the `sqlite_ext` module.
* Support literal column names with the `dataset` module.

[View commits](https://github.com/coleifer/peewee/compare/2.10.1...2.10.2)

## 2.10.1

Removed `AESEncryptedField`.

[View commits](https://github.com/coleifer/peewee/compare/2.10.0...2.10.1)

## 2.10.0

The main change in this release is the removal of the `AESEncryptedField`,
which was included as part of the `playhouse.fields` extension. It was brought
to my attention that there was some serious potential for security
vulnerabilities. Rather than give users a false sense of security, I've decided
the best course of action is to remove the field.

* Remove the `playhouse.fields.AESEncryptedField` over security concerns
described in ticket #1264.
* Correctly resolve explicit table dependencies when creating tables, refs
  #1076. Thanks @maaaks.
* Implement not equals comparison for `CompositeKey`.

[View commits](https://github.com/coleifer/peewee/compare/2.9.2...2.10.0)

## 2.9.2

* Fixed significant bug in the `savepoint` commit/rollback implementation. Many
  thanks to @Syeberman for raising the issue. See #1225 for details.
* Added support for postgresql `INTERVAL` columns. The new `IntervalField` in
  the `postgres_ext` module is suitable for storing `datetime.timedelta`.
* Fixed bug where missing `sqlite3` library was causing other, unrelated
  libraries to throw errors when attempting to import.
* Added a `case_sensitive` parameter to the SQLite `REGEXP` function
  implementation. The default is `False`, to preserve backwards-compatibility.
* Fixed bug that caused tables not to be created when using the `dataset`
  extension. See #1213 for details.
* Modified `drop_table` to raise an exception if the user attempts to drop
  tables with `CASCADE` when the database backend does not support it.
* Fixed Python3 issue in the `AESEncryptedField`.
* Modified the behavior of string-typed fields to treat the addition operator
  as concatenation. See #1241 for details.

[View commits](https://github.com/coleifer/peewee/compare/2.9.1...2.9.2)

## 2.9.1

* Fixed #1218, where the use of `playhouse.flask_utils` was requiring the
  `sqlite3` module to be installed.
* Fixed #1219 regarding the SQL generation for composite key sub-selects,
  joins, etc.

[View commits](https://github.com/coleifer/peewee/compare/2.9.0...2.9.1)

## 2.9.0

In this release there are two notable changes:

* The ``Model.create_or_get()`` method was removed. See the [documentation](http://docs.peewee-orm.com/en/latest/peewee/querying.html#create-or-get)
  for an example of the code one would write to replicate this functionality.
* The SQLite closure table extension gained support for many-to-many
  relationships thanks to a nice PR by @necoro. [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#ClosureTable).

[View commits](https://github.com/coleifer/peewee/compare/2.8.8...2.9.0)

## 2.8.8

This release contains a single important bugfix for a regression in specifying
the type of lock to use when opening a SQLite transaction.

[View commits](https://github.com/coleifer/peewee/compare/2.8.7...2.8.8)

## 2.8.7

This release contains numerous cleanups.

### Bugs fixed

* #1087 - Fixed a misuse of the iteration protocol in the `sqliteq` extension.
* Ensure that driver exceptions are wrapped when calling `commit` and
  `rollback`.
* #1096 - Fix representation of recursive foreign key relations when using the
  `model_to_dict` helper.
* #1126 - Allow `pskel` to be installed into `bin` directory.
* #1105 - Added a `Tuple()` type to Peewee to enable expressing arbitrary
  tuple expressions in SQL.
* #1133 - Fixed bug in the conversion of objects to `Decimal` instances in the
  `DecimalField`.
* Fixed an issue renaming a unique foreign key in MySQL.
* Remove the join predicate from CROSS JOINs.
* #1148 - Ensure indexes are created when a column is added using a schema
  migration.
* #1165 - Fix bug where the primary key was being overwritten in queries using
  the closure-table extension.

### New stuff

* Added properties to the `SqliteExtDatabase` to expose common `PRAGMA`
  settings. For example, to set the cache size to 4MB, `db.cache_size = 1000`.
* Clarified documentation on calling `commit()` or `rollback()` from within the
  scope of an atomic block. [See docs](http://docs.peewee-orm.com/en/latest/peewee/transactions.html#transactions).
* Allow table creation dependencies to be specified using new `depends_on` meta
  option. Refs #1076.
* Allow specification of the lock type used in SQLite transactions. Previously
  this behavior was only present in `playhouse.sqlite_ext.SqliteExtDatabase`,
  but it now exists in `peewee.SqliteDatabase`.
* Added support for `CROSS JOIN` expressions in select queries.
* Docs on how to implement [optimistic locking](http://docs.peewee-orm.com/en/latest/peewee/hacks.html#optimistic-locking).
* Documented optional dependencies.
* Generic support for specifying select queries as locking the selected rows
  `FOR X`, e.g. `FOR UPDATE` or `FOR SHARE`.
* Support for specifying the frame-of-reference in window queries, e.g.
  specifying `UNBOUNDED PRECEDING`, etc. [See docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#Window).

### Backwards-incompatible changes

* As of 9e76c99, an `OperationalError` is raised if the user calls `connect()`
  on an already-open Database object. Previously, the existing connection would
  remain open and a new connection would overwrite it, making it impossible to
  close the previous connection. If you find this is causing breakage in your
  application, you can switch the `connect()` call to `get_conn()` which will
  only open a connection if necessary. The error **is** indicative of a real
  issue, though, so audit your code for places where you may be opening a
  connection without closing it (module-scope operations, e.g.).

[View commits](https://github.com/coleifer/peewee/compare/2.8.5...2.8.7)

## 2.8.6

This release was later removed due to containing a bug. See notes on 2.8.7.

## 2.8.5

This release contains two small bugfixes.

* #1081 - fixed the use of parentheses in compound queries on MySQL.
* Fixed some grossness in a helper function used by `prefetch` that was
  clearing out the `GROUP BY` and `HAVING` clauses of sub-queries.

[View commits](https://github.com/coleifer/peewee/compare/2.8.4...2.8.5)

## 2.8.4

This release contains bugfixes as well as a new playhouse extension module for
working with [SQLite in multi-threaded / concurrent environments](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#sqliteq).
The new module is called `playhouse.sqliteq` and it works by serializing
queries using a dedicated worker thread (or greenlet). The performance is quite
good, hopefully this proves useful to someone besides myself! You can learn
more by reading the [sqliteq documentation](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#sqliteq).

As a miscellaneous note, I did some major refactoring and cleanup in
`ExtQueryResultsWrapper` and it's corollary in the `speedups` module. The code
is much easier to read than before.

[View commits](https://github.com/coleifer/peewee/compare/2.8.3...2.8.4)

### Bugs fixed

* #1061 - @akrs patched a bug in `TimestampField` which affected the accuracy
  of sub-second timestamps (for resolution > 1).
* #1071, small python 3 fix.
* #1072, allow `DeferredRelation` to be used multiple times if there are
  multiple references to a given deferred model.
* #1073, fixed regression in the speedups module that caused SQL functions to
  always coerce return values, regardless of the `coerce` flag.
* #1083, another Python 3 issue - this time regarding the use of `exc.message`.

[View commits](https://github.com/coleifer/peewee/compare/2.8.3...2.8.4)

## 2.8.3

This release contains bugfixes and a small backwards-incompatible change to the
way foreign key `ObjectIdDescriptor` is named (issue #1050).

### Bugs fixed and general changes

* #1028 - allow the `ensure_join` method to accept `on` and `join_type`
  parameters. Thanks @paulbooth.
* #1032 - fix bug related to coercing model instances to database parameters
  when the model's primary key is a foreign key.
* #1035 - fix bug introduced in 2.8.2, where I had added some logic to try and
  restrict the base `Model` class from being treated as a "real" Model.
* #1039 - update documentation to clarify that lists *or tuples* are acceptable
  values when specifying SQLite `PRAGMA` statements.
* #1041 - PyPy user was unable to install Peewee. (Who in their right mind
  would *ever* use PyPy?!) Bug was fixed by removing the pre-generated C files
  from the distribution.
* #1043 - fix bug where the `speedups` C extension was not calling the correct
  model initialization method, resulting in model instances returned as results
  of a query having their `dirty` flag incorrectly set.
* #1048 - similar to #1043, add logic to ensure that fields with default values
  are considered dirty when instantiating the model.
* #1049 - update URL to [APSW](https://rogerbinns.github.io/apsw).
* Fixed unreported bug regarding `TimestampField` with zero values reporting
  the incorrect datetime.

### New stuff

* [djpeewee](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#djpeewee) extension
  module now works with Django 1.9.
* [TimestampField](http://docs.peewee-orm.com/en/latest/peewee/api.html#TimestampField)
  is now an officially documented field.
* #1050 - use the `db_column` of a `ForeignKeyField` for the name of the
  `ObjectIdDescriptor`, except when the `db_column` and field `name` are the
  same, in which case the ID descriptor will be named `<field_name>_id`.

[View commits](https://github.com/coleifer/peewee/compare/2.8.2...2.8.3)

## 2.8.2

This release contains mostly bug-fixes, clean-ups, and API enhancements.

### Bugs fixed and general cleanups

* #820 - fixed some bugs related to the Cython extension build process.
* #858 - allow blanks and perform type conversion when using the `db_url`
  extension
* #922 - ensure that `peewee.OperationalError` is raised consistently when
  using the `RetryOperationalError` mixin.
* #929 - ensure that `pwiz` will import the appropriate extensions when
  vendor-specific fields are used.
* #930 - ensure that `pwiz`-generated models containing `UnknownField`
  placeholders do not blow up when you instantiate them.
* #932 - correctly limit the length of automatically-generated index names.
* #933 - fixed bug where `BlobField` could not be used if it's parent model
  pointed to an uninitialized database `Proxy`.
* #935 - greater consistency with the conversion to Python data-types when
  performing aggregations, annotations, or calling `scalar()`.
* #939 - ensure the correct data-types are used when initializing a connection
  pool.
* #947 - fix bug where `Signal` subclasses were not returning rows affected on
  save.
* #951 - better warnings regarding C extension compilation, thanks @dhaase-de.
* #968 - fix bug where table names starting with numbers generated invalid
  table names when using `pwiz`.
* #971 - fix bug where parameter was not being used. Thanks @jberkel.
* #974 - fixed the way `SqliteExtDatabase` handles the automatic `rowid` (and
    `docid`) columns. Thanks for alerting me to the issue and providing a
    failing test case @jberkel.
* #976 - fix obscure bug relating to cloning foreign key fields twice.
* #981 - allow `set` instances to be used on the right-hand side of `IN` exprs.
* #983 - fix behavior where the default `id` primary key was inherited
  regardless. When users would inadvertently include it in their queries, it
  would use the table alias of it's parent class.
* #992 - add support for `db_column` in `djpeewee`
* #995 - fix the behavior of `truncate_date` with Postgresql. Thanks @Zverik.
* #1011 - correctly handle `bytes` wrapper used by `PasswordField` to `bytes`.
* #1012 - when selecting and joining on multiple models, do not create model
  instances when the foreign key is NULL.
* #1017 - do not coerce the return value of function calls to `COUNT` or `SUM`,
  since the python driver will already give us the right Python value.
* #1018 - use global state to resolve `DeferredRelations`, allowing for a nicer
  API. Thanks @brenguyen711.
* #1022 - attempt to avoid creating invalid Python when using `pwiz` with MySQL
  database columns containing spaces. Yes, fucking spaces.
* #1024 - fix bug in SQLite migrator which had a naive approach to fixing
  indexes.
* #1025 - explicitly check for `None` when determining if the database has been
  set on `ModelOptions`. Thanks @joeyespo.

### New stuff

* Added `TimestampField` for storing datetimes using integers. Greater than
  second delay is possible through exponentiation.
* Added `Database.drop_index()` method.
* Added a `max_depth` parameter to the `model_to_dict` function in
  the `playhouse.shortcuts` extension module.
* `SelectQuery.first()` function accepts a parameter `n` which
  applies a limit to the query and returns the first row. Previously the limit
  was not applied out of consideration for subsequent iterations, but I believe
  usage has shown that a limit is more desirable than reserving the option to
  iterate without a second query. The old behavior is preserved in the new
  `SelectQuery.peek()` method.
* `group_by()`, `order_by()`, `window()` now accept a keyward argument
  `extend`, which, when set to `True`, will append to the existing values
  rather than overwriting them.
* Query results support negative indexing.
* C sources are included now as part of the package. I *think* they should be
  able to compile for python 2 or 3, on linux or windows...but not positive.
* #895 - added the ability to query using the `<foreign_key>_id` attribute.
* #948 - added documentation about SQLite limits and how they affect
* #1009 - allow `DATABASE_URL` as a recognized parameter to the Flask config.
  `insert_many`.

[View commits](https://github.com/coleifer/peewee/compare/2.8.1...2.8.2)

## 2.8.1

This release is long overdue so apologies if you've been waiting on it and
running off master. There are numerous bugfixes contained in this release, so
I'll list those first this time.

### Bugs fixed

* #821 - issue warning if Cython is old
* #822 - better handling of MySQL connections
point for advanced use-cases.
* #313 - support equality/inequality with generic foreign key queries, and
ensure `get_or_create` works with GFKs.
* #834 - fixed Python3 incompatibilities in the `PasswordField`, thanks
@mosquito.
* #836 - fix handling of `last_insert_id()` when using `APSWDatabase`.
* #845 - add connection hooks to `APSWDatabase`.
* #852 - check SQLite library version to avoid calls to missing APIs.
* #857 - allow database definition to be deferred when using the connection
pool.
* #878 - formerly `.limit(0)` had no effect. Now adds `LIMIT 0`.
* #879 - implement a `__hash__` method for `Model`
* #886 - fix `count()` for compound select queries.
* #895 - allow writing to the `foreign_key_id` descriptor to set the foreign
key value.
* #893 - fix boolean logic bug in `model_to_dict()`.
* #904 - fix side-effect in `clean_prefetch_query`, thanks to @p.kamayev
* #907 - package includes `pskel` now.
* #852 - fix sqlite version check in BerkeleyDB backend.
* #919 - add runtime check for `sqlite3` library to match MySQL and Postgres.
Thanks @M157q

### New features

* Added a number of [SQLite user-defined functions and
aggregates](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#sqlite-udf).
* Use the DB-API2 `Binary` type for `BlobField`.
* Implemented the lucene scoring algorithm in the `sqlite_ext` Cython library.
* #825 - allow a custom base class for `ModelOptions`, providing an extension
* #830 - added `SmallIntegerField` type.
* #838 - allow using a custom descriptor class with `ManyToManyField`.
* #855 - merged change from @lez which included docs on using peewee with
Pyramid.
* #858 - allow arguments to be passed on query-string when using the `db_url`
module. Thanks @RealSalmon
* #862 - add support for `truncate table`, thanks @dev-zero for the sample
code.
* Allow the `related_name` model `Meta` option to be a callable that accepts
the foreign key field instance.


[View commits](https://github.com/coleifer/peewee/compare/2.8.0...2.8.1)

## 2.8.0

This release includes a couple new field types and greatly improved C extension support for both speedups and SQLite enhancements. Also includes some work, suggested by @foxx, to remove some places where `Proxy` was used in favor of more obvious APIs.

### New features

* [travis-ci builds](http://travis-ci.org/coleifer/peewee/builds/) now include MySQL and Python 3.5. Dropped support for Python 3.2 and 3.3. Builds also will run the C-extension code.
* C extension speedups now enabled by default, includes faster implementations for `dict` and `tuple` `QueryResultWrapper` classes, faster date formatting, and a faster field and model sorting.
* C implementations of SQLite functions is now enabled by default. SQLite extension is now compatible with APSW and can be used in standalone form directly from Python. See [SqliteExtDatabase](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#SqliteExtDatabase) for more details.
* SQLite C extension now supports `murmurhash2`.
* `UUIDField` is now supported for SQLite and MySQL, using `text` and `varchar` respectively, thanks @foxx!
* Added `BinaryField`, thanks again, @foxx!
* Added `PickledField` to `playhouse.fields`.
* `ManyToManyField` now accepts a list of primary keys when adding or removing values from the through relationship.
* Added support for SQLite [table-valued functions](http://sqlite.org/vtab.html#tabfunc2) using the [sqlite-vtfunc library](https://github.com/coleifer/sqlite-vtfunc).
* Significantly simplified the build process for compiling the C extensions.

### Backwards-incompatible changes

* Instead of using a `Proxy` for defining circular foreign key relationships, you now need to use [DeferredRelation](http://docs.peewee-orm.com/en/latest/peewee/api.html#DeferredRelation).
* Instead of using a `Proxy` for defining many-to-many through tables, you now need to use [DeferredThroughModel](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#DeferredThroughModel).
* SQLite Virtual Models must now use `Meta.extension_module` and `Meta.extension_options` to declare extension and any options. For more details, see [VirtualModel](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#VirtualModel).
* MySQL database will now issue `COMMIT` statements for `SELECT` queries. This was not necessary, but added due to an influx of confused users creating GitHub tickets. Hint: learn to user your damn database, it's not magic!

### Bugs fixed

Some of these may have been included in a previous release, but since I did not list them I'm listing them here.

* #766, fixed bug with PasswordField and Python3. Fuck Python 3.
* #768, fixed SortedFieldList and `remove_field()`. Thanks @klen!
* #771, clarified docs for APSW.
* #773, added docs for request hooks in Pyramid (who uses Pyramid, by the way?).
* #774, prefetch() only loads first ForeignKeyField for a given relation.
* #782, fixed typo in docs.
* #791, foreign keys were not correctly handling coercing to the appropriate python value.
* #792, cleaned up some CSV utils code.
* #798, cleaned up iteration protocol in QueryResultWrappers.
* #806, not really a bug, but MySQL users were clowning around and needed help.

[View commits](https://github.com/coleifer/peewee/compare/2.7.4...2.8.0)

## 2.7.4

This is another small release which adds code to automatically build the SQLite C extension if `libsqlite` is available. The release also includes:

* Support for `UUIDField` with SQLite.
* Support for registering additional database classes with the `db_url` module via `register_database`.
* `prefetch()` supports fetching multiple foreign-keys to the same model class.
* Added method to validate FTS5 search queries.

[View commits](https://github.com/coleifer/peewee/compare/2.7.3...2.7.4)

## 2.7.3

Small release which includes some changes to the BM25 sorting algorithm and the addition of a [`JSONField`](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#JSONField) for use with the new [JSON1 extension](http://sqlite.org/json1.html).

## 2.7.2

People were having trouble building the sqlite extension. I figure enough people are having trouble that I made it a separate command: `python setup.py build_sqlite_ext`.

## 2.7.1

Jacked up the setup.py

## 2.7.0

New APIs, features, and performance improvements.

### Notable changes and new features

* [`PasswordField`](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#PasswordField) that uses the `bcrypt` module.
* Added new Model [`Meta.only_save_dirty`](http://docs.peewee-orm.com/en/latest/peewee/models.html#model-options-and-table-metadata) flag to, by default, only save fields that have been modified.
* Added support for [`upsert()`](http://docs.peewee-orm.com/en/latest/peewee/api.html#InsertQuery.upsert) on MySQL (in addition to SQLite).
* Implemented SQLite ranking functions (``rank`` and ``bm25``) in Cython, and changed both the Cython and Python APIs to accept weight values for every column in the search index. This more closely aligns with the APIs provided by FTS5. In fact, made the APIs for FTS4 and FTS5 result ranking compatible.
* Major changes to the :ref:`sqlite_ext` module. Function callbacks implemented in Python were implemented in Cython (e.g. date manipulation and regex processing) and will be used if Cython is available when Peewee is installed.
* Support for the experimental new [FTS5](http://sqlite.org/fts5.html) SQLite search extension.
* Added :py:class:`SearchField` for use with the SQLite FTS extensions.
* Added :py:class:`RowIDField` for working with the special ``rowid`` column in SQLite.
* Added a model class validation hook to allow model subclasses to perform any validation after class construction. This is currently used to ensure that ``FTS5Model`` subclasses do not violate any rules required by the FTS5 virtual table.

### Bugs fixed

* **#751**, fixed some very broken behavior in the MySQL migrator code. Added more tests.
* **#718**, added a `RetryOperationalError` mixin that will try automatically reconnecting after a failed query. There was a bug in the previous error handler implementation that made this impossible, which is also fixed.

#### Small bugs

* #713, fix column name regular expression in SQLite migrator.
* #724, fixed `NULL` handling with the Postgresql `JSONField`.
* #725, added `__module__` attribute to `DoesNotExist` classes.
* #727, removed the `commit_select` logic for MySQL databases.
* #730, added documentation for `Meta.order_by` API.
* #745, added `cast()` method for casting JSON field values.
* #748, added docs and method override to indicate that SQLite does not support adding foreign key constraints after table creation.
* Check whether pysqlite or libsqlite were compiled with BerkeleyDB support when using the :py:class:`BerkeleyDatabase`.
* Clean up the options passed to SQLite virtual tables on creation.

### Small features

* #700, use sensible default if field's declared data-type is not present in the field type map.
* #707, allow model to be specified explicitly in `prefetch()`.
* #734, automatic testing against python 3.5.
* #753, added support for `upsert()` ith MySQL via the `REPLACE INTO ...` statement.
* #757, `pwiz`, the schema intropsection tool, will now generate multi-column index declarations.
* #756, `pwiz` will capture passwords using the `getpass()` function rather than via the command-line.
* Removed `Database.sql_error_handler()`, replaced with the `RetryOperationalError` mixin class.
* Documentation for `Meta.order_by` and `Meta.primary_key`.
* Better documentation around column and table constraints.
* Improved performance for some methods that are called frequently.
* Added `coerce` parameter to `BareField` and added documentation.

[View commits](https://github.com/coleifer/peewee/compare/2.6.4...2.7.0)


## 2.6.4

Updating so some of the new APIs are available on pypi.

### Bugs fixed

* #646, fixed a bug with the Cython speedups not being included in package.
* #654, documented how to create models with no primary key.
* #659, allow bare `INSERT` statements.
* #674, regarding foreign key / one-to-one relationships.
* #676, allow `ArrayField` to accept tuples in addition to lists.
* #679, fix regarding unsaved relations.
* #682, refactored QueryResultWrapper to allow multiple independent iterations over the same underlying result cache.
* #692, fix bug with multiple joins to same table + eager loading.
* #695, fix bug when connection fails while using an execution context.
* #698, use correct column names with non-standard django foreign keys.
* #706, return `datetime.time` instead of `timedelta` for MySQL time fields.
* #712, fixed SQLite migrator regular expressions. Thanks @sroebert.

### New features

* #647, #649, #650, added support for `RETURNING` clauses. Update, Insert and Delete queries can now be called with `RETURNING` to retrieve the rows that were affected. [See docs](http://docs.peewee-orm.com/en/latest/peewee/querying.html#returning-clause).
* #685, added web request hook docs.
* #691, allowed arbitrary model attributes and methods to be serialized by `model_to_dict()`. [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#model_to_dict).
* #696, allow `model_to_dict()` to introspect query for which fields to serialize.
* Added backend-agnostic [truncate_date()](http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.truncate_date) implementation.
* Added a `FixedCharField` which uses column type `CHAR`.
* Added support for arbitrary `PRAGMA` statements to be run on new SQLite connections. [Docs](http://docs.peewee-orm.com/en/latest/peewee/databases.html#sqlite-pragma).
* Removed `berkeley_build.sh` script. See instructions [on my blog instead](http://charlesleifer.com/blog/building-the-python-sqlite-driver-for-use-with-berkeleydb/).

[View commits](https://github.com/coleifer/peewee/compare/2.6.2...2.6.4)

## 2.6.2

Just a regular old release.

### Bugs fixed

* #641, fixed bug with exception wrapping and Python 2.6
* #634, fixed bug where correct query result wrapper was not being used for certain composite queries.
* #625, cleaned up some example code.
* #614, fixed bug with `aggregate_rows()` when there are multiple joins to the same table.

### New features

* Added [create_or_get()](http://docs.peewee-orm.com/en/latest/peewee/querying.html#create-or-get) as a companion to `get_or_create()`.
* Added support for `ON CONFLICT` clauses for `UPDATE` and `INSERT` queries. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#UpdateQuery.on_conflict).
* Added a [JSONKeyStore](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#JSONKeyStore) to `playhouse.kv`.
* Added Cythonized version of `strip_parens()`, with plans to perhaps move more performance-critical code to Cython in the future.
* Added docs on specifying [vendor-specific database parameters](http://docs.peewee-orm.com/en/latest/peewee/database.html#vendor-specific-parameters).
* Added docs on specifying [field default values](http://docs.peewee-orm.com/en/latest/peewee/models.html#default-field-values) (both client and server-side).
* Added docs on [foreign key field back-references](http://docs.peewee-orm.com/en/latest/peewee/models.html#foreignkeyfield).
* Added docs for [models without a primary key](http://docs.peewee-orm.com/en/latest/peewee/models.html#models-without-a-primary-key).
* Cleaned up docs on `prefetch()` and `aggregate_rows()`.

[View commits](https://github.com/coleifer/peewee/compare/2.6.1...2.6.2)

## 2.6.1

This release contains a number of small fixes and enhancements.

### Bugs fixed

* #606, support self-referential joins with `prefetch` and `aggregate_rows()` methods.
* #588, accomodate changes in SQLite's `PRAGMA index_list()` return value.
* #607, fixed bug where `pwiz` was not passing table names to introspector.
* #591, fixed bug with handling of named cursors in older psycopg2 version.
* Removed some cruft from the `APSWDatabase` implementation.

### New features

* Added [CompressedField](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#CompressedField) and [AESEncryptedField](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#AESEncryptedField)
* #609, #610, added Django-style foreign key ID lookup. [Docs](http://docs.peewee-orm.com/en/latest/peewee/models.html#foreignkeyfield).
* Added support for [Hybrid Attributes](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#hybrid-attributes) (cool idea courtesy of SQLAlchemy).
* Added ``upsert`` keyword argument to the `Model.save()` function (SQLite only).
* #587, added support for ``ON CONFLICT`` SQLite clause for `INSERT` and `UPDATE` queries. [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#UpdateQuery.on_conflict)
* #601, added hook for programmatically defining table names. [Model options docs](http://docs.peewee-orm.com/en/latest/peewee/models.html#model-options-and-table-metadata)
* #581, #611, support connection pools with `playhouse.db_url.connect()`. [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#connect).
* Added [Contributing section](http://docs.peewee-orm.com/en/latest/peewee/contributing.html) section to docs.

[View commits](https://github.com/coleifer/peewee/compare/2.6.0...2.6.1)

## 2.6.0

This is a tiny update, mainly consisting of a new-and-improved implementation of ``get_or_create()`` ([docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.get_or_create)).

### Backwards-incompatible changes

* ``get_or_create()`` now returns a 2-tuple consisting of the model instance and a boolean indicating whether the instance was created. The function now behaves just like the Django equivalent.

### New features

* #574, better support for setting the character encoding on Postgresql database connections. Thanks @klen!
* Improved implementation of [get_or_create()](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.get_or_create).

[View commits](https://github.com/coleifer/peewee/compare/2.5.1...2.6.0)

## 2.5.1

This is a relatively small release with a few important bugfixes.

### Bugs fixed

* #566, fixed a bug regarding parentheses around compound `SELECT` queries (i.e. `UNION`, `INTERSECT`, etc).
* Fixed unreported bug where table aliases were not generated correctly for compound `SELECT` queries.
* #559, add option to preserve original column order with `pwiz`. Thanks @elgow!
* Fixed unreported bug where selecting all columns from a `ModelAlias` does not use the appropriate `FieldAlias` objects.

### New features

* #561, added an option for bulk insert queries to return the list of auto-generated primary keys. See [docs for InsertQuery.return_id_list](http://docs.peewee-orm.com/en/latest/peewee/api.html#InsertQuery.return_id_list).
* #569, added `parse` function to the `playhouse.db_url` module. Thanks @stt!
* Added [hacks](http://docs.peewee-orm.com/en/latest/peewee/hacks.html) section to the docs. Please contribute your hacks!

### Backwards-incompatible changes

* Calls to `Node.in_()` and `Node.not_in()` do not take `*args` anymore and instead take a single argument.

[View commits](https://github.com/coleifer/peewee/compare/2.5.0...2.5.1)

## 2.5.0

There are a couple new features so I thought I'd bump to 2.5.x. One change Postgres users may be happy to see is the use of `INSERT ... RETURNING` to perform inserts. This should definitely speed up inserts for Postgres, since an extra query is no longer needed to get the new auto-generated primary key.

I also added a [new context manager/decorator](http://docs.peewee-orm.com/en/latest/peewee/database.html#using-multiple-databases) that allows you to use a different database for the duration of the wrapped block.

### Bugs fixed

* #534, CSV utils was erroneously stripping the primary key from CSV data.
* #537, fix upserts when using `insert_many`.
* #541, respect `autorollback` with `PostgresqlExtDatabase`. Thanks @davidmcclure.
* #551, fix for QueryResultWrapper's implementation of the iterator protocol.
* #554, allow SQLite journal_mode to be set at run-time.
* Fixed case-sensitivity issue with `DataSet`.

### New features

* Added support for [CAST expressions](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#cast).
* Added a hook for [extending Node](http://docs.peewee-orm.com/en/latest/peewee/api.html#Node.extend) with custom methods.
* `JOIN_<type>` became `JOIN.<type>`, e.g. `.join(JOIN.LEFT_OUTER)`.
* `OP_<code>` became `OP.<code>`.
* #556, allowed using `+` and `-` prefixes to indicate ascending/descending ordering.
* #550, added [Database.initialize_connection()](http://docs.peewee-orm.com/en/latest/peewee/database.html#additional-connection-initialization) hook.
* #549, bind selected columns to a particular model. Thanks @jhorman, nice PR!
* #531, support for swapping databases at run-time via [Using](http://docs.peewee-orm.com/en/latest/peewee/database.html#using-multiple-databases).
* #530, support for SQLCipher and Python3.
* New `RowIDField` for `sqlite_ext` playhouse module. This field can be used to interact with SQLite `rowid` fields.
* Added `LateralJoin` helper to the `postgres_ext` playhouse module.
* New [example blog app](https://github.com/coleifer/peewee/tree/master/examples/blog).

[View commits](https://github.com/coleifer/peewee/compare/2.4.7...2.5.0)

## 2.4.7

### Bugs fixed

* #504, Docs updates.
* #506, Fixed regression in `aggregate_rows()`
* #510, Fixes bug in pwiz overwriting columns.
* #514, Correctly cast foreign keys in `prefetch()`.
* #515, Simplifies queries issued when doing recursive deletes.
* #516, Fix cloning of Field objects.
* #519, Aggregate rows now correctly preserves ordering of joined instances.
* Unreported, fixed bug to not leave expired connections sitting around in the pool.

### New features

* Added support for Postgresql's ``jsonb`` type with [BinaryJSONField](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#BinaryJSONField).
* Add some basic [Flask helpers](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#flask-utils).
* Add support for `UNION ALL` queries in #512
* Add `SqlCipherExtDatabase`, which combines the sqlcipher database with the sqlite extensions.
* Add option to print metadata when generating code with ``pwiz``.

[View commits](https://github.com/coleifer/peewee/compare/2.4.6...2.4.7)

## 2.4.6

This is a relatively small release with mostly bug fixes and updates to the documentation. The one new feature I'd like to highlight is the ``ManyToManyField`` ([docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#ManyToManyField)).

### Bugs fixed

* #503, fixes behavior of `aggregate_rows()` when used with a `CompositeKey`.
* #498, fixes value coercion for field aliases.
* #492, fixes bug with pwiz and composite primary keys.
* #486, correctly handle schemas with reflection module.

### New features

* Peewee has a new [ManyToManyField](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#ManyToManyField) available in the ``playhouse.shortcuts`` module.
* Peewee now has proper support for *NOT IN* queries through the ``Node.not_in()`` method.
* Models now support iteration. This is equivalent to ``Model.select()``.

[View commits](https://github.com/coleifer/peewee/compare/2.4.5...2.4.6)

## 2.4.5

I'm excited about this release, as in addition to a number of new features and bugfixes, it also is a step towards cleaner code. I refactored the tests into a number of modules, using a standard set of base test-cases and helpers. I also introduced the `mock` library into the test suite and plan to use it for cleaner tests going forward. There's a lot of work to do to continue cleaning up the tests, but I'm feeling good about the changes. Curiously, the test suite runs faster now.

### Bugs fixed

* #471, #482 and #484, all of which had to do with how joins were handled by the `aggregate_rows()` query result wrapper.
* #472 removed some needless special-casing in `Model.save()`.
* #466 fixed case-sensitive issues with the SQLite migrator.
* #474 fixed a handful of bugs that cropped up migrating foreign keys with SQLite.
* #475 fixed the behavior of the SQLite migrator regarding auto-generated indexes.
* #479 fixed a bug in the code that stripped extra parentheses in the SQL generator.
* Fixed a handful of bugs in the APSW extension.

### New features

* Added connection abstraction called `ExecutionContext` ([see docs](http://docs.peewee-orm.com/en/latest/peewee/database.html#advanced-connection-management)).
* Made all context managers work as decorators (`atomic`, `transaction`, `savepoint`, `execution_context`).
* Added explicit methods for `IS NULL` and `IS NOT NULL` queries. The latter was actually necessary since the behavior is different from `NOT IS NULL (...)`.
* Allow disabling backref validation (#465)
* Made quite a few improvements to the documentation, particularly sections on transactions.
* Added caching to the [DataSet](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#dataset) extension, which should improve performance.
* Made the SQLite migrator smarter with regards to preserving indexes when a table copy is necessary.

[View commits](https://github.com/coleifer/peewee/compare/2.4.4...2.4.5)

## 2.4.4

Biggest news: peewee has a new logo!

![](https://media.charlesleifer.com/blog/photos/peewee-logo-bold.png)

* Small documentation updates here and there.

### Backwards-incompatible changes

* The argument signature for the `SqliteExtDatabase.aggregate()` decorator changed so that the aggregate name is the first parameter, and the number of parameters is the second parameter. If no values are specified, peewee will choose the name of the class and an un-specified number of arguments (`-1`).
* The logic for saving a model with a composite key changed slightly. Previously, if a model had a composite primary key and you called `save()`, only the dirty fields would be saved.

### Bugs fixed

* #462
* #465, add hook for disabling backref validation.
* #466, fix case-sensitive table names with migration module.
* #469, save only dirty fields.

### New features

* Lots of enhancements and cleanup to the `playhouse.apsw_ext` module.
* The `playhouse.reflection` module now supports introspecting indexes.
* Added a model option for disabling backref validation.
* Added support for the SQLite [closure table extension](http://charlesleifer.com/blog/querying-tree-structures-in-sqlite-using-python-and-the-transitive-closure-extension/).
* Added support for *virtual fields*, which act on dynamically-created virtual table fields.
* Added a new example: a virtual table implementation that exposes Redis as a relational database table.
* Added a module `playhouse.sqlite_aggregates` that contains a handful of aggregates you may find useful when developing with SQLite.


[View commits](https://github.com/coleifer/peewee/compare/2.4.3...2.4.4)

## 2.4.3

This release contains numerous improvements, particularly around the built-in database introspection utilities. Peewee should now also be compatible with PyPy.

### Bugs fixed

* #466, table names are case sensitive in the SQLite migrations module.
* #465, added option to disable backref validation.
* #462, use the schema name consistently with postgres reflection.

### New features

* New model *Meta* option to disable backref validation. [See validate_backrefs](http://docs.peewee-orm.com/en/latest/peewee/models.html#model-options-and-table-metadata).
* Added documentation on ordering by calculated values.
* Added basic PyPy compatibility.
* Added logic to close cursors after they have been exhausted.
* Structured and consolidated database metadata introspection, including improvements for introspecting indexes.
* Added support to [prefetch](http://docs.peewee-orm.com/en/latest/peewee/api.html?highlight=prefetch#prefetch) for traversing *up* the query tree.
* Added introspection option to skip invalid models while introspecting.
* Added option to limit the tables introspected.
* Added closed connection detection to the MySQL connection pool.
* Enhancements to passing options to creating virtual tables with SQLite.
* Added factory method for generating Closure tables for use with the `transitive_closure` SQLite extension.
* Added support for loading SQLite extensions.
* Numerous test-suite enhancements and new test-cases.

[View commits](https://github.com/coleifer/peewee/compare/2.4.2...2.4.3)

## 2.4.2

This release contains a number of improvements to the `reflection` and `migrate` extension modules. I also added an encrypted *diary* app to the [examples](https://github.com/coleifer/peewee/tree/master/examples) directory.

### Bugs fixed

* #449, typo in the db_url extension, thanks to @malea for the fix.
* #457 and #458, fixed documentation deficiences.

### New features

* Added support for [importing data](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#importing-data) when using the [DataSet extension](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#dataset).
* Added an encrypted diary app to the examples.
* Better index reconstruction when altering columns on SQLite databases with the [migrate](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#migrate) module.
* Support for multi-column primary keys in the [reflection](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#reflection) module.
* Close cursors more aggressively when executing SELECT queries.

[View commits](https://github.com/coleifer/peewee/compare/2.4.1...2.4.2)

## 2.4.1

This release contains a few small bugfixes.

### Bugs fixed

* #448, add hook to the connection pool for detecting closed connections.
* #229, fix join attribute detection.
* #447, fixed documentation typo.

[View commits](https://github.com/coleifer/peewee/compare/2.4.0...2.4.1)

## 2.4.0

This release contains a number of enhancements to the `playhouse` collection of extensions.

### Backwards-incompatible changes

As of 2.4.0, most of the introspection logic was moved out of the ``pwiz`` module and into ``playhouse.reflection``.

### New features

* Created a new [reflection](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#reflection) extension for introspecting databases. The *reflection* module additionally can generate actual peewee Model classes dynamically.
* Created a [dataset](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#dataset) library (based on the [SQLAlchemy project](https://dataset.readthedocs.io/) of the same name). For more info check out the blog post [announcing playhouse.dataset](http://charlesleifer.com/blog/saturday-morning-hacks-dataset-for-peewee/).
* Added a [db_url](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#database-url) module which creates `Database` objects from a connection string.
* Added [csv dump](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#dumping-csv) functionality to the [CSV utils](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#csv-utils) extension.
* Added an [atomic](http://docs.peewee-orm.com/en/latest/peewee/transactions.html#nesting-transactions) context manager to support nested transactions.
* Added support for HStore, JSON and TSVector to the `reflection` module.
* More documentation updates.

### Bugs fixed

* Fixed #440, which fixes a bug where `Model.dirty_fields` did not return an empty set for some subclasses of `QueryResultWrapper`.

[View commits](https://github.com/coleifer/peewee/compare/2.3.3...2.4.0)

## 2.3.3

This release contains a lot of improvements to the documentation and a mixed bag of other new features and bugfixes.

### Backwards-incompatible changes

As of 2.3.3, all peewee `Database` instances have a default of `True` for the `threadlocals` parameter. This means that a connection is opened for each thread. It seemed to me that by sharing connections across threads caused a lot of confusion to users who weren't aware of (or familiar with) the `threadlocals` parameter. For single-threaded apps the behavior will not be affected, but for multi-threaded applications, if you wish to share your connection across threads you must now specify `threadlocals=False`. For more information, see the [documentation](http://docs.peewee-orm.com/en/latest/peewee/api.html#Database).

I also renamed the `Model.get_id()` and `Model.set_id()` convenience methods so as not to conflict with Flask-Login. These methods should have probably been private anyways, and the new methods are named `_get_pk_value()` and `_set_pk_value()`.

### New features

* Basic support for [Postgresql full-text search](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pg-fts).
* Helper functions for converting models to dictionaries and unpacking dictionaries into model instances. See [docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#model_to_dict).

### Bugs fixed

* Fixed #428, documentation formatting error.
* Fixed #429, which fixes the way default values are initialized for bulk inserts.
* Fixed #432, making the HStore extension optional when using `PostgresqlExtDatabase`.
* Fixed #435, allowing peewee to be used with Flask-Login.
* Fixed #436, allowing the SQLite date_part and date_trunc functions to correctly handle NULL values.
* Fixed #438, in which the ordering of clauses in a Join expression were causing unpredictable behavior when selecting related instances.
* Updated the `berkeley_build.sh` script, which was incompatible with the newest version of `bsddb3`.

[View commits](https://github.com/coleifer/peewee/compare/2.3.2...2.3.3)

## 2.3.2

This release contains mostly bugfixes.

### Changes in 2.3.2

* Fixed #421, allowing division operations to work correctly in py3k.
* Added support for custom json.dumps command, thanks to @alexlatchford.
* Fixed some foreign key generation bugs with pwiz in #426.
* Fixed a parentheses bug with UNION queries, #422.
* Added support for returning partial JSON data-structures from postgresql.

[View commits](https://github.com/coleifer/peewee/compare/2.3.1...2.3.2)

## 2.3.1

This release contains a fix for a bug introducted in 2.3.0. Table names are included, unquoted, in update queries now, which is causing some problems when the table name is a keyword.

### Changes in 2.3.1

* [Quote table name / alias](https://github.com/coleifer/peewee/issues/414)

[View commits](https://github.com/coleifer/peewee/compare/2.3.0...2.3.1)

## 2.3.0

This release contains a number of bugfixes, enhancements and a rewrite of much of the documentation.

### Changes in 2.3.0

* [New and improved documentation](http://docs.peewee-orm.com/)
* Added [aggregate_rows()](http://docs.peewee-orm.com/en/latest/peewee/querying.html#list-users-and-all-their-tweets) method for mitigating N+1 queries.
* Query compiler performance improvements and rewrite of table alias internals (51d82fcd and d8d55df04).
* Added context-managers and decorators for [counting queries](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#count_queries) and [asserting query counts](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#assert_query_count).
* Allow `UPDATE` queries to contain subqueries for values ([example](http://docs.peewee-orm.com/en/latest/peewee/querying.html#atomic-updates)).
* Support for `INSERT INTO / SELECT FROM` queries ([docs](http://docs.peewee-orm.com/en/latest/peewee/api.html?highlight=insert_from#Model.insert_from)).
* Allow `SqliteDatabase` to set the database's journal mode.
* Added method for concatenation ([docs]()).
* Moved ``UUIDField`` out of the playhouse and into peewee
* Added [pskel](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pskel) script.
* Documentation for [BerkeleyDB](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#berkeleydb).

### Bugs fixed

* #340, allow inner query values to be used in outer query joins.
* #380, fixed foreign key handling in SQLite migrations.
* #389, mark foreign keys as dirty on assignment.
* #391, added an ``orwhere()`` method.
* #392, fixed ``order_by`` meta option inheritance bug.
* #394, fixed UUID and conversion of foreign key values (thanks @alexlatchford).
* #395, allow selecting all columns using ``SQL('*')``.
* #396, fixed query compiler bug that was adding unnecessary parentheses around expressions.
* #405, fixed behavior of ``count()`` when query has a limit or offset.

[View commits](https://github.com/coleifer/peewee/compare/2.2.5...2.3.0)

## 2.2.5

This is a small release and contains a handful of fixes.

### Changes in 2.2.5

* Added a `Window` object for creating reusable window definitions.
* Added support for `DISTINCT ON (...)`.
* Added a BerkeleyDB-backed sqlite `Database` and build script.
* Fixed how the `UUIDField` handles `None` values (thanks @alexlatchford).
* Fixed various things in the example app.
* Added 3.4 to the travis build (thanks @frewsxcv).

[View commits](https://github.com/coleifer/peewee/compare/2.2.4...2.2.5)

## 2.2.4

This release contains a complete rewrite of `pwiz` as well as some improvements to the SQLite extension, including support for the BM25 ranking algorithm for full-text searches. I also merged support for sqlcipher, an encrypted SQLite database with many thanks to @thedod!

### Changes in 2.2.4

* Rewrite of `pwiz`, schema introspection utility.
* `Model.save()` returns a value indicating the number of modified rows.
* Fixed bug with `PostgresqlDatabase.last_insert_id()` leaving a transaction open in autocommit mode (#353).
* Added BM25 ranking algorithm for full-text searches with SQLite.

[View commits](https://github.com/coleifer/peewee/compare/2.2.3...2.2.4)

## 2.2.3

This release contains a new migrations module in addition to a number of small features and bug fixes.

### Changes in 2.2.3

* New migrations module.
* Added a return value to `Model.save()` indicating number of rows affected.
* Added a `date_trunc()` method that works for Sqlite.
* Added a `Model.sqlall()` class-method to return all the SQL to generate the model / indices.

### Bugs fixed

* #342, allow functions to not coerce parameters automatically.
* #338, fixed unaliased columns when using Array and Json fields with postgres, thanks @mtwesley.
* #331, corrected issue with the way unicode arrays were adapted with psycopg2.
* #328, pwiz / mysql bug.
* #326, fixed calculation of the alias_map when using subqueries.
* #324, bug with `prefetch()` not selecting the correct primary key.


[View commits](https://github.com/coleifer/peewee/compare/2.2.2...2.2.3)


## 2.2.1

I've been looking forward to this release, as it contains a couple new features
that I've been wanting to add for some time now. Hope you find them useful.

### Changes in 2.2.1

* Window queries using ``OVER`` syntax.
* Compound query operations ``UNION``, ``INTERSECT``, ``EXCEPT`` as well as symmetric difference.

### Bugs fixed

* #300, pwiz was not correctly interpreting some foreign key constraints in SQLite.
* #298, drop table with cascade API was missing.
* #294, typo.

[View commits](https://github.com/coleifer/peewee/compare/2.2.0...2.2.1)

## 2.2.0

This release contains a large refactoring of the way SQL was generated for both
the standard query classes (`Select`, `Insert`, `Update`, `Delete`) as well as
for the DDL methods (`create_table`, `create_index`, etc). Instead of joining
strings of SQL and manually quoting things, I've created `Clause` objects
containing multiple `Node` objects to represent all parts of the query.

I also changed the way peewee determins the SQL to represent a field. Now a
field implements ``__ddl__`` and ``__ddl_column__`` methods. The former creates
the entire field definition, e.g.:

    "quoted_column_name" <result of call to __ddl_column__> [NOT NULL/PRIMARY KEY/DEFAULT NEXTVAL(...)/CONSTRAINTS...]

The latter method is responsible just for the column type definition. This might
return ``VARCHAR(255)`` or simply ``TEXT``. I've also added support for
arbitrary constraints on each field, so you might have:

    price = DecimalField(decimal_places=2, constraints=[Check('price > 0')])

### Changes in 2.2.0

* Refactored query generation for both SQL queries and DDL queries.
* Support for arbitrary column constraints.
* `autorollback` option to the `Database` class that will roll back the
  transaction before raising an exception.
* Added `JSONField` type to the `postgresql_ext` module.
* Track fields that are explicitly set, allowing faster saves (thanks @soasme).
* Allow the `FROM` clause to be an arbitrary `Node` object (#290).
* `schema` is a new `Model.Mketa` option and is used throughout the code.
* Allow indexing operation on HStore fields (thanks @zdxerr, #293).

### Bugs fixed

* #277 (where calls not chainable with update query)
* #278, use `wraps()`, thanks @lucasmarshall
* #284, call `prepared()` after `create()`, thanks @soasme.
* #286, cursor description issue with pwiz + postgres

[View commits](https://github.com/coleifer/peewee/compare/2.1.7...2.2.0)


## 2.1.7

### Changes in 2.1.7

* Support for savepoints (Sqlite, Postgresql and MySQL) using an API similar to that of transactions.
* Common set of exceptions to wrap DB-API 2 driver-specific exception classes, e.g. ``peewee.IntegrityError``.
* When pwiz cannot determine the underlying column type, display it in a comment in the generated code.
* Support for circular foreign-keys.
* Moved ``Proxy`` into peewee (previously in ``playhouse.proxy``).
* Renamed ``R()`` to ``SQL()``.
* General code cleanup, some new comments and docstrings.

### Bugs fixed

* Fixed a small bug in the way errors were handled in transaction context manager.
* #257
* #265, nest multiple calls to functions decorated with `@database.commit_on_success`.
* #266
* #267

Commits: https://github.com/coleifer/peewee/compare/2.1.6...2.1.7
Released 2013-12-25

## 2.1.6

Changes included in 2.1.6:

* [Lightweight Django integration](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#django-integration).
* Added a [csv loader](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#csv-loader) to playhouse.
* Register unicode converters per-connection instead of globally when using `pscyopg2`.
* Fix for how the related object cache is invalidated (#243).

Commits: https://github.com/coleifer/peewee/compare/2.1.5...2.1.6
Released 2013-11-19

## 2.1.5

### Summary of new features

* Rewrote the ``playhouse.postgres_ext.ServerSideCursor`` helper to work with a single query.  [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#server-side-cursors).
* Added error handler hook to the database class, allowing your code to choose how to handle errors executing SQL.  [Docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#Database.sql_error_handler).
* Allow arbitrary attributes to be stored in ``Model.Meta`` a5e13bb26d6196dbd24ff228f99ff63d9c046f79.
* Support for composite primary keys (!!).  [How-to](http://docs.peewee-orm.com/en/latest/peewee/cookbook.html#composite-primary-keys) and [API docs](http://docs.peewee-orm.com/en/latest/peewee/api.html#CompositeKey).
* Added helper for generating ``CASE`` expressions.  [Docs](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#case).
* Allow the table alias to be specified as a model ``Meta`` option.
* Added ability to specify ``NOWAIT`` when issuing ``SELECT FOR UPDATE`` queries.

### Bug fixes

* #147, SQLite auto-increment behavior.
* #222
* #223, missing call to ``execute()`` in docs.
* #224, python 3 compatibility fix.
* #227, was using wrong column type for boolean with MySQL.

Commits: https://github.com/coleifer/peewee/compare/2.1.4...2.1.5
Released 2013-10-19

## 2.1.4

* Small refactor of some components used to represent expressions (mostly better names).
* Support for [Array fields](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#ArrayField) in postgresql.
* Added notes on [Proxy](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#proxy)
* Support for [Server side cursors](http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#server-side-cursors) with postgresql.
* Code cleanups for more consistency.

Commits: https://github.com/coleifer/peewee/compare/2.1.3...2.1.4
Released 2013-08-05

## 2.1.3

* Added the ``sqlite_ext`` module, including support for virtual tables, full-text search, user-defined functions, collations and aggregates, as well as more granular locking.
* Manually convert data-types when doing simple aggregations - fixes issue #208
* Profiled code and dramatically increased performance of benchmarks.
* Added a proxy object for lazy database initialization - fixes issue #210

Commits: https://github.com/coleifer/peewee/compare/2.1.2...2.1.3
Released 2013-06-28

-------------------------------------

## 2.0.0

Major rewrite, see notes here: http://docs.peewee-orm.com/en/latest/peewee/upgrading.html#upgrading


================================================
FILE: LICENSE
================================================
Copyright (c) 2010 Charles Leifer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: MANIFEST.in
================================================
include CHANGELOG.md
include LICENSE
include README.rst
include TODO.rst
include pyproject.toml
include runtests.py
include tests.py
include playhouse/*.c
include playhouse/*.pyx
include playhouse/README.md
recursive-include examples *
recursive-include docs *


================================================
FILE: README.rst
================================================
.. image:: https://media.charlesleifer.com/blog/photos/peewee4-logo.png

peewee
======

Peewee is a simple and small ORM. It has few (but expressive) concepts, making it easy to learn and intuitive to use.

* a small, expressive ORM
* flexible query-builder that exposes full power of SQL
* supports sqlite, mysql, mariadb, postgresql
* asyncio support
* tons of extensions
* use with `flask <https://docs.peewee-orm.com/en/latest/peewee/framework_integration.html#flask>`__,
  `fastapi <https://docs.peewee-orm.com/en/latest/peewee/framework_integration.html#fastapi>`__,
  `pydantic <https://docs.peewee-orm.com/en/latest/peewee/orm_utils.html#module-playhouse.pydantic_utils>`__, and
  `more <https://docs.peewee-orm.com/en/latest/peewee/framework_integration.html>`__.

New to peewee? These may help:

* `Quickstart <https://docs.peewee-orm.com/en/latest/peewee/quickstart.html#quickstart>`_
* `Example twitter app <https://docs.peewee-orm.com/en/latest/peewee/example.html#example>`_
* `Using peewee interactively <https://docs.peewee-orm.com/en/latest/peewee/interactive.html#interactive>`_
* `Models and fields <http://docs.peewee-orm.com/en/latest/peewee/models.html>`_
* `Querying <http://docs.peewee-orm.com/en/latest/peewee/querying.html>`_
* `Relationships and joins <http://docs.peewee-orm.com/en/latest/peewee/relationships.html>`_
* `Extensive library of SQL / Peewee examples <https://docs.peewee-orm.com/en/latest/peewee/query_library.html#query-library>`_
* `Flask setup <https://docs.peewee-orm.com/en/latest/peewee/framework_integration.html#flask>`_
  or `FastAPI setup <https://docs.peewee-orm.com/en/latest/peewee/framework_integration.html#fastapi>`_

Installation:

.. code-block:: console

    pip install peewee

Sqlite comes built-in provided by the standard-lib ``sqlite3`` module. Other
backends can be installed using the following instead:

.. code-block:: console

    pip install peewee[mysql]  # Install peewee with pymysql.
    pip install peewee[postgres]  # Install peewee with psycopg2.
    pip install peewee[psycopg3]  # Install peewee with psycopg3.

    # AsyncIO implementations.
    pip install peewee[aiosqlite]  # Install peewee with aiosqlite.
    pip install peewee[aiomysql]  # Install peewee with aiomysql.
    pip install peewee[asyncpg]  # Install peewee with asyncpg.

Examples
--------

Defining models is similar to Django or SQLAlchemy:

.. code-block:: python

    from peewee import *
    import datetime


    db = SqliteDatabase('my_database.db')

    class BaseModel(Model):
        class Meta:
            database = db

    class User(BaseModel):
        username = CharField(unique=True)

    class Tweet(BaseModel):
        user = ForeignKeyField(User, backref='tweets')
        message = TextField()
        created_date = DateTimeField(default=datetime.datetime.now)
        is_published = BooleanField(default=True)

Connect to the database and create tables:

.. code-block:: python

    db.connect()
    db.create_tables([User, Tweet])

Create a few rows:

.. code-block:: python

    charlie = User.create(username='charlie')
    huey = User(username='huey')
    huey.save()

    # No need to set `is_published` or `created_date` since they
    # will just use the default values we specified.
    Tweet.create(user=charlie, message='My first tweet')

Queries are expressive and composable:

.. code-block:: python

    # A simple query selecting a user.
    User.get(User.username == 'charlie')

    # Get tweets created by one of several users.
    usernames = ['charlie', 'huey', 'mickey']
    users = User.select().where(User.username.in_(usernames))
    tweets = Tweet.select().where(Tweet.user.in_(users))

    # We could accomplish the same using a JOIN:
    tweets = (Tweet
              .select()
              .join(User)
              .where(User.username.in_(usernames)))

    # How many tweets were published today?
    tweets_today = (Tweet
                    .select()
                    .where(
                        (Tweet.created_date >= datetime.date.today()) &
                        (Tweet.is_published == True))
                    .count())

    # Paginate the user table and show me page 3 (users 41-60).
    User.select().order_by(User.username).paginate(3, 20)

    # Order users by the number of tweets they've created:
    tweet_ct = fn.Count(Tweet.id)
    users = (User
             .select(User, tweet_ct.alias('ct'))
             .join(Tweet, JOIN.LEFT_OUTER)
             .group_by(User)
             .order_by(tweet_ct.desc()))

    # Do an atomic update (for illustrative purposes only, imagine a simple
    # table for tracking a "count" associated with each URL). We don't want to
    # naively get the save in two separate steps since this is prone to race
    # conditions.
    Counter.update(count=Counter.count + 1).where(Counter.url == request.url)

Check out the `example twitter app <http://docs.peewee-orm.com/en/latest/peewee/example.html>`_.

Learning more
-------------

Check the `documentation <http://docs.peewee-orm.com/>`_ for more examples.

Specific question? Come hang out in the #peewee channel on irc.libera.chat, or post to the mailing list, http://groups.google.com/group/peewee-orm . If you would like to report a bug, `create a new issue <https://github.com/coleifer/peewee/issues/new>`_ on GitHub.

Still want more info?
---------------------

.. image:: https://media.charlesleifer.com/blog/photos/wat.jpg

I've written a number of blog posts about building applications and web-services with peewee (and usually Flask). If you'd like to see some real-life applications that use peewee, the following resources may be useful:

* `Building a note-taking app with Flask and Peewee <https://charlesleifer.com/blog/saturday-morning-hack-a-little-note-taking-app-with-flask/>`_ as well as `Part 2 <https://charlesleifer.com/blog/saturday-morning-hacks-revisiting-the-notes-app/>`_ and `Part 3 <https://charlesleifer.com/blog/saturday-morning-hacks-adding-full-text-search-to-the-flask-note-taking-app/>`_.
* `Analytics web service built with Flask and Peewee <https://charlesleifer.com/blog/saturday-morning-hacks-building-an-analytics-app-with-flask/>`_.
* `Personalized news digest (with a boolean query parser!) <https://charlesleifer.com/blog/saturday-morning-hack-personalized-news-digest-with-boolean-query-parser/>`_.
* `Structuring Flask apps with Peewee <https://charlesleifer.com/blog/structuring-flask-apps-a-how-to-for-those-coming-from-django/>`_.
* `Creating a lastpass clone with Flask and Peewee <https://charlesleifer.com/blog/creating-a-personal-password-manager/>`_.
* `Creating a bookmarking web-service that takes screenshots of your bookmarks <https://charlesleifer.com/blog/building-bookmarking-service-python-and-phantomjs/>`_.
* `Building a pastebin, wiki and a bookmarking service using Flask and Peewee <https://charlesleifer.com/blog/dont-sweat-small-stuff-use-flask-blueprints/>`_.
* `Encrypted databases with Python and SQLCipher <https://charlesleifer.com/blog/encrypted-sqlite-databases-with-python-and-sqlcipher/>`_.
* `Dear Diary: An Encrypted, Command-Line Diary with Peewee <https://charlesleifer.com/blog/dear-diary-an-encrypted-command-line-diary-with-python/>`_.


================================================
FILE: bench.py
================================================
from peewee import *


db = SqliteDatabase(':memory:')
#db = PostgresqlDatabase('peewee_test', host='127.0.0.1', port=26257, user='root')
#db = PostgresqlDatabase('peewee_test', host='127.0.0.1', user='postgres')
#from playhouse.cysqlite_ext import CySqliteDatabase
#db = CySqliteDatabase(':memory:')
#from playhouse.apsw_ext import APSWDatabase
#db = APSWDatabase(':memory:')

class Base(Model):
    class Meta:
        database = db

class Register(Base):
    value = IntegerField()

class Collection(Base):
    name = TextField()

class Item(Base):
    collection = ForeignKeyField(Collection, backref='items')
    name = TextField()

import functools
import time

def timed(fn):
    @functools.wraps(fn)
    def inner(*args, **kwargs):
        times = []
        N = 20
        for i in range(N):
            start = time.perf_counter()
            fn(i, *args, **kwargs)
            times.append(time.perf_counter() - start)
        print('%0.3f ... %s' % (round(sum(times) / N, 3), fn.__name__))
    return inner

def populate_register(s, n):
    for i in range(s, n):
        Register.create(value=i)

def populate_collections(n, n_i):
    for i in range(n):
        c = Collection.create(name=str(i))
        for j in range(n_i):
            Item.create(collection=c, name=str(j))

@timed
def insert(i):
    with db.atomic():
        populate_register((i * 1000), (i + 1) * 1000)

@timed
def batch_insert(i):
    it = range(i * 1000, (i + 1) * 1000)
    for i in db.batch_commit(it, 100):
        Register.insert(value=i).execute()

@timed
def bulk_insert(i):
    with db.atomic():
        for i in range(i * 1000, (i + 1) * 1000, 100):
            data = [(j,) for j in range(i, i + 100)]
            Register.insert_many(data, fields=[Register.value]).execute()

@timed
def bulk_create(i):
    with db.atomic():
        data = [Register(value=i) for i in range(i * 1000, (i + 1) * 1000)]
        Register.bulk_create(data, batch_size=100)

@timed
def select(i):
    query = Register.select()
    for row in query:
        pass

@timed
def select_related_dbapi_raw(i):
    query = Item.select(Item, Collection).join(Collection)
    cursor = db.execute(query)
    for row in cursor:
        pass

@timed
def insert_related(i):
    with db.atomic():
        populate_collections(30, 60)

@timed
def select_related(i):
    query = Item.select(Item, Collection).join(Collection)
    for item in query:
        pass

@timed
def select_related_left(i):
    query = Collection.select(Collection, Item).join(Item, JOIN.LEFT_OUTER)
    for collection in query:
        pass

@timed
def select_related_dicts(i):
    query = Item.select(Item, Collection).join(Collection).dicts()
    for row in query:
        pass

@timed
def select_related_objects(i):
    query = Item.select(Item, Collection).join(Collection).objects()
    for item in query:
        pass

@timed
def select_prefetch(i):
    query = prefetch(Collection.select(), Item)
    for c in query:
        for i in c.items:
            pass

@timed
def select_prefetch_join(i):
    query = prefetch(Collection.select(), Item,
                     prefetch_type=PREFETCH_TYPE.JOIN)
    for c in query:
        for i in c.items:
            pass


if __name__ == '__main__':
    db.create_tables([Register, Collection, Item])
    insert()
    insert_related()
    Register.delete().execute()
    batch_insert()
    assert Register.select().count() == 20000
    Register.delete().execute()
    bulk_insert()
    assert Register.select().count() == 20000
    Register.delete().execute()
    bulk_create()
    assert Register.select().count() == 20000
    select()
    select_related()
    select_related_left()
    select_related_objects()
    select_related_dicts()
    select_related_dbapi_raw()
    select_prefetch()
    select_prefetch_join()
    db.drop_tables([Register, Collection, Item])


================================================
FILE: docs/Makefile
================================================
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
PAPER         =
BUILDDIR      = _build

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html       to make standalone HTML files"
	@echo "  dirhtml    to make HTML files named index.html in directories"
	@echo "  singlehtml to make a single large HTML file"
	@echo "  pickle     to make pickle files"
	@echo "  json       to make JSON files"
	@echo "  htmlhelp   to make HTML files and a HTML help project"
	@echo "  qthelp     to make HTML files and a qthelp project"
	@echo "  devhelp    to make HTML files and a Devhelp project"
	@echo "  epub       to make an epub"
	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
	@echo "  text       to make text files"
	@echo "  man        to make manual pages"
	@echo "  changes    to make an overview of all changed/added/deprecated items"
	@echo "  linkcheck  to check all external links for integrity"
	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"

clean:
	-rm -rf $(BUILDDIR)/*

html:
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
	@echo
	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
	@echo
	@echo "Build finished; now you can process the pickle files."

json:
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
	@echo
	@echo "Build finished; now you can process the JSON files."

htmlhelp:
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
	@echo
	@echo "Build finished; now you can run HTML Help Workshop with the" \
	      ".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
	@echo
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/peewee.qhcp"
	@echo "To view the help file:"
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/peewee.qhc"

devhelp:
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
	@echo
	@echo "Build finished."
	@echo "To view the help file:"
	@echo "# mkdir -p $$HOME/.local/share/devhelp/peewee"
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/peewee"
	@echo "# devhelp"

epub:
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
	@echo
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
	      "(use \`make latexpdf' here to do that automatically)."

latexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through pdflatex..."
	make -C $(BUILDDIR)/latex all-pdf
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
	@echo
	@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
	@echo
	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes:
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
	@echo
	@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
	@echo
	@echo "Link check complete; look for any errors in the above output " \
	      "or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
	@echo "Testing of doctests in the sources finished, look at the " \
	      "results in $(BUILDDIR)/doctest/output.txt."


================================================
FILE: docs/_themes/flask/layout.html
================================================
{%- extends "basic/layout.html" %}
{%- block extrahead %}
  {{ super() }}
  {% if theme_touch_icon %}
  <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" />
  {% endif %}
  <link media="only screen and (max-device-width: 480px)" href="{{
    pathto('_static/small_flask.css', 1) }}" type= "text/css" rel="stylesheet" />
{% endblock %}
{%- block relbar2 %}{% endblock %}
{% block header %}
  {{ super() }}
  {% if pagename == 'index' %}
  <div class=indexwrapper>
  {% endif %}
{% endblock %}
{%- block footer %}
  <div class="footer">
    &copy; Copyright {{ copyright }}.
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
  </div>
  {% if pagename == 'index' %}
  </div>
  {% endif %}
{%- endblock %}


================================================
FILE: docs/_themes/flask/relations.html
================================================
<h3>Related Topics</h3>
<ul>
  <li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul>
  {%- for parent in parents %}
  <li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul>
  {%- endfor %}
    {%- if prev %}
      <li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter')
        }}">{{ prev.title }}</a></li>
    {%- endif %}
    {%- if next %}
      <li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter')
        }}">{{ next.title }}</a></li>
    {%- endif %}
  {%- for parent in parents %}
  </ul></li>
  {%- endfor %}
  </ul></li>
</ul>


================================================
FILE: docs/_themes/flask/static/flasky.css_t
================================================
/*
 * flasky.css_t
 * ~~~~~~~~~~~~
 *
 * :copyright: Copyright 2010 by Armin Ronacher.
 * :license: Flask Design License, see LICENSE for details.
 */

{% set page_width = '940px' %}
{% set sidebar_width = '220px' %}
 
@import url("basic.css");
 
/* -- page layout ----------------------------------------------------------- */
 
body {
    font-family: 'Georgia', serif;
    font-size: 17px;
    background-color: white;
    color: #000;
    margin: 0;
    padding: 0;
}

div.document {
    width: {{ page_width }};
    margin: 30px auto 0 auto;
}

div.documentwrapper {
    float: left;
    width: 100%;
}

div.bodywrapper {
    margin: 0 0 0 {{ sidebar_width }};
}

div.sphinxsidebar {
    width: {{ sidebar_width }};
}

hr {
    border: 1px solid #B1B4B6;
}
 
div.body {
    background-color: #ffffff;
    color: #3E4349;
    padding: 0 30px 0 30px;
}

img.floatingflask {
    padding: 0 0 10px 10px;
    float: right;
}
 
div.footer {
    width: {{ page_width }};
    margin: 20px auto 30px auto;
    font-size: 14px;
    color: #888;
    text-align: right;
}

div.footer a {
    color: #888;
}

div.related {
    display: none;
}
 
div.sphinxsidebar a {
    color: #444;
    text-decoration: none;
    border-bottom: 1px dotted #999;
}

div.sphinxsidebar a:hover {
    border-bottom: 1px solid #999;
}
 
div.sphinxsidebar {
    font-size: 14px;
    line-height: 1.5;
}

div.sphinxsidebarwrapper {
    padding: 18px 10px;
}

div.sphinxsidebarwrapper p.logo {
    padding: 0 0 20px 0;
    margin: 0;
    text-align: center;
}
 
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
    font-family: 'Garamond', 'Georgia', serif;
    color: #444;
    font-size: 24px;
    font-weight: normal;
    margin: 0 0 5px 0;
    padding: 0;
}

div.sphinxsidebar h4 {
    font-size: 20px;
}
 
div.sphinxsidebar h3 a {
    color: #444;
}

div.sphinxsidebar p.logo a,
div.sphinxsidebar h3 a,
div.sphinxsidebar p.logo a:hover,
div.sphinxsidebar h3 a:hover {
    border: none;
}
 
div.sphinxsidebar p {
    color: #555;
    margin: 10px 0;
}

div.sphinxsidebar ul {
    margin: 10px 0;
    padding: 0;
    color: #000;
}
 
div.sphinxsidebar input {
    border: 1px solid #ccc;
    font-family: 'Georgia', serif;
    font-size: 1em;
}
 
/* -- body styles ----------------------------------------------------------- */
 
a {
    color: #004B6B;
    text-decoration: underline;
}
 
a:hover {
    color: #6D4100;
    text-decoration: underline;
}
 
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
    font-family: 'Garamond', 'Georgia', serif;
    font-weight: normal;
    margin: 30px 0px 10px 0px;
    padding: 0;
}

{% if theme_index_logo %}
div.indexwrapper h1 {
    text-indent: -999999px;
    background: url({{ theme_index_logo }}) no-repeat center center;
    height: {{ theme_index_logo_height }};
}
{% endif %}
 
div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
div.body h2 { font-size: 180%; }
div.body h3 { font-size: 150%; }
div.body h4 { font-size: 130%; }
div.body h5 { font-size: 100%; }
div.body h6 { font-size: 100%; }
 
a.headerlink {
    color: #ddd;
    padding: 0 4px;
    text-decoration: none;
}
 
a.headerlink:hover {
    color: #444;
    background: #eaeaea;
}
 
div.body p, div.body dd, div.body li {
    line-height: 1.4em;
}

div.admonition {
    background: #fafafa;
    margin: 20px -30px;
    padding: 10px 30px;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

div.admonition tt.xref, div.admonition a tt {
    border-bottom: 1px solid #fafafa;
}

dd div.admonition {
    margin-left: -60px;
    padding-left: 60px;
}

div.admonition p.admonition-title {
    font-family: 'Garamond', 'Georgia', serif;
    font-weight: normal;
    font-size: 24px;
    margin: 0 0 10px 0;
    padding: 0;
    line-height: 1;
}

div.admonition p.last {
    margin-bottom: 0;
}

div.highlight {
    background-color: white;
}

dt:target, .highlight {
    background: #FAF3E8;
}

div.note {
    background-color: #eee;
    border: 1px solid #ccc;
}
 
div.seealso {
    background-color: #ffc;
    border: 1px solid #ff6;
}
 
div.topic {
    background-color: #eee;
}
 
p.admonition-title {
    display: inline;
}
 
p.admonition-title:after {
    content: ":";
}

pre, tt {
    font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
    font-size: 0.9em;
}

img.screenshot {
}

tt.descname, tt.descclassname {
    font-size: 0.95em;
}

tt.descname {
    padding-right: 0.08em;
}

img.screenshot {
    -moz-box-shadow: 2px 2px 4px #eee;
    -webkit-box-shadow: 2px 2px 4px #eee;
    box-shadow: 2px 2px 4px #eee;
}

table.docutils {
    border: 1px solid #888;
    -moz-box-shadow: 2px 2px 4px #eee;
    -webkit-box-shadow: 2px 2px 4px #eee;
    box-shadow: 2px 2px 4px #eee;
}

table.docutils td, table.docutils th {
    border: 1px solid #888;
    padding: 0.25em 0.7em;
}

table.field-list, table.footnote {
    border: none;
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: none;
}

table.footnote {
    margin: 15px 0;
    width: 100%;
    border: 1px solid #eee;
    background: #fdfdfd;
    font-size: 0.9em;
}

table.footnote + table.footnote {
    margin-top: -15px;
    border-top: none;
}

table.field-list th {
    padding: 0 0.8em 0 0;
}

table.field-list td {
    padding: 0;
}

table.footnote td.label {
    width: 0px;
    padding: 0.3em 0 0.3em 0.5em;
}

table.footnote td {
    padding: 0.3em 0.5em;
}

dl {
    margin: 0;
    padding: 0;
}

dl dd {
    margin-left: 30px;
}

blockquote {
    margin: 0 0 0 30px;
    padding: 0;
}

ul, ol {
    margin: 10px 0 10px 30px;
    padding: 0;
}
 
pre {
    background: #eee;
    padding: 7px 30px;
    margin: 15px -30px;
    line-height: 1.3em;
}

dl pre, blockquote pre, li pre {
    margin-left: -60px;
    padding-left: 60px;
}

dl dl pre {
    margin-left: -90px;
    padding-left: 90px;
}
 
tt {
    background-color: #ecf0f3;
    color: #222;
    /* padding: 1px 2px; */
}

tt.xref, a tt {
    background-color: #FBFBFB;
    border-bottom: 1px solid white;
}

a.reference {
    text-decoration: none;
    border-bottom: 1px dotted #004B6B;
}

a.reference:hover {
    border-bottom: 1px solid #6D4100;
}

a.footnote-reference {
    text-decoration: none;
    font-size: 0.7em;
    vertical-align: top;
    border-bottom: 1px dotted #004B6B;
}

a.footnote-reference:hover {
    border-bottom: 1px solid #6D4100;
}

a:hover tt {
    background: #EEE;
}


================================================
FILE: docs/_themes/flask/static/small_flask.css
================================================
/*
 * small_flask.css_t
 * ~~~~~~~~~~~~~~~~~
 *
 * :copyright: Copyright 2010 by Armin Ronacher.
 * :license: Flask Design License, see LICENSE for details.
 */

body {
    margin: 0;
    padding: 20px 30px;
}

div.documentwrapper {
    float: none;
    background: white;
}

div.sphinxsidebar {
    display: block;
    float: none;
    width: 102.5%;
    margin: 50px -30px -20px -30px;
    padding: 10px 20px;
    background: #333;
    color: white;
}

div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
div.sphinxsidebar h3 a {
    color: white;
}

div.sphinxsidebar a {
    color: #aaa;
}

div.sphinxsidebar p.logo {
    display: none;
}

div.document {
    width: 100%;
    margin: 0;
}

div.related {
    display: block;
    margin: 0;
    padding: 10px 0 20px 0;
}

div.related ul,
div.related ul li {
    margin: 0;
    padding: 0;
}

div.footer {
    display: none;
}

div.bodywrapper {
    margin: 0;
}

div.body {
    min-height: 0;
    padding: 0;
}


================================================
FILE: docs/_themes/flask/theme.conf
================================================
[theme]
inherit = basic
stylesheet = flasky.css
pygments_style = flask_theme_support.FlaskyStyle

[options]
index_logo = ''
index_logo_height = 120px
touch_icon = 


================================================
FILE: docs/clubdata.sql
================================================
--
-- PostgreSQL database dump
--
--CREATE DATABASE exercises;
--\c exercises
--CREATE SCHEMA cd;



-- Dumped from database version 9.2.0
-- Dumped by pg_dump version 9.2.0
-- Started on 2013-05-19 16:05:10 BST

SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;

--
-- TOC entry 171 (class 1259 OID 32818)
-- Name: bookings; Type: TABLE; Schema: cd; Owner: -; Tablespace:
--

CREATE TABLE bookings (
    bookid integer NOT NULL,
    facid integer NOT NULL,
    memid integer NOT NULL,
    starttime timestamp without time zone NOT NULL,
    slots integer NOT NULL
);


--
-- TOC entry 169 (class 1259 OID 32770)
-- Name: facilities; Type: TABLE; Schema: cd; Owner: -; Tablespace:
--

CREATE TABLE facilities (
    facid integer NOT NULL,
    name character varying(100) NOT NULL,
    membercost numeric NOT NULL,
    guestcost numeric NOT NULL,
    initialoutlay numeric NOT NULL,
    monthlymaintenance numeric NOT NULL
);


--
-- TOC entry 170 (class 1259 OID 32800)
-- Name: members; Type: TABLE; Schema: cd; Owner: -; Tablespace:
--

CREATE TABLE members (
    memid integer NOT NULL,
    surname character varying(200) NOT NULL,
    firstname character varying(200) NOT NULL,
    address character varying(300) NOT NULL,
    zipcode integer NOT NULL,
    telephone character varying(20) NOT NULL,
    recommendedby integer,
    joindate timestamp without time zone NOT NULL
);


--
-- TOC entry 2202 (class 0 OID 32818)
-- Dependencies: 171
-- Data for Name: bookings; Type: TABLE DATA; Schema: cd; Owner: -
--

INSERT INTO bookings (bookid, facid, memid, starttime, slots) VALUES
(0, 3, 1, '2012-07-03 11:00:00', 2),
(1, 4, 1, '2012-07-03 08:00:00', 2),
(2, 6, 0, '2012-07-03 18:00:00', 2),
(3, 7, 1, '2012-07-03 19:00:00', 2),
(4, 8, 1, '2012-07-03 10:00:00', 1),
(5, 8, 1, '2012-07-03 15:00:00', 1),
(6, 0, 2, '2012-07-04 09:00:00', 3),
(7, 0, 2, '2012-07-04 15:00:00', 3),
(8, 4, 3, '2012-07-04 13:30:00', 2),
(9, 4, 0, '2012-07-04 15:00:00', 2),
(10, 4, 0, '2012-07-04 17:30:00', 2),
(11, 6, 0, '2012-07-04 12:30:00', 2),
(12, 6, 0, '2012-07-04 14:00:00', 2),
(13, 6, 1, '2012-07-04 15:30:00', 2),
(14, 7, 2, '2012-07-04 14:00:00', 2),
(15, 8, 2, '2012-07-04 12:00:00', 1),
(16, 8, 3, '2012-07-04 18:00:00', 1),
(17, 1, 0, '2012-07-05 17:30:00', 3),
(18, 2, 1, '2012-07-05 09:30:00', 3),
(19, 3, 3, '2012-07-05 09:00:00', 2),
(20, 3, 1, '2012-07-05 19:00:00', 2),
(21, 4, 3, '2012-07-05 18:30:00', 2),
(22, 6, 0, '2012-07-05 13:00:00', 2),
(23, 6, 1, '2012-07-05 14:30:00', 2),
(24, 7, 2, '2012-07-05 18:30:00', 2),
(25, 8, 3, '2012-07-05 12:30:00', 1),
(26, 0, 0, '2012-07-06 08:00:00', 3),
(27, 0, 0, '2012-07-06 14:00:00', 3),
(28, 0, 2, '2012-07-06 15:30:00', 3),
(29, 2, 1, '2012-07-06 17:00:00', 3),
(30, 3, 1, '2012-07-06 11:00:00', 2),
(31, 4, 3, '2012-07-06 12:00:00', 2),
(32, 6, 1, '2012-07-06 14:00:00', 2),
(33, 7, 2, '2012-07-06 08:30:00', 2),
(34, 7, 2, '2012-07-06 13:30:00', 2),
(35, 8, 3, '2012-07-06 15:30:00', 1),
(36, 0, 2, '2012-07-07 08:30:00', 3),
(37, 0, 0, '2012-07-07 12:30:00', 3),
(38, 0, 2, '2012-07-07 14:30:00', 3),
(39, 1, 3, '2012-07-07 08:30:00', 3),
(40, 2, 1, '2012-07-07 09:00:00', 3),
(41, 2, 1, '2012-07-07 11:30:00', 3),
(42, 2, 1, '2012-07-07 16:00:00', 3),
(43, 3, 2, '2012-07-07 12:30:00', 2),
(44, 4, 3, '2012-07-07 11:30:00', 2),
(45, 4, 3, '2012-07-07 14:00:00', 2),
(46, 4, 0, '2012-07-07 17:30:00', 2),
(47, 6, 0, '2012-07-07 08:30:00', 2),
(48, 6, 1, '2012-07-07 10:30:00', 2),
(49, 6, 1, '2012-07-07 14:30:00', 2),
(50, 6, 0, '2012-07-07 16:00:00', 2),
(51, 7, 2, '2012-07-07 11:30:00', 2),
(52, 8, 3, '2012-07-07 16:00:00', 1),
(53, 8, 3, '2012-07-07 17:30:00', 2),
(54, 0, 3, '2012-07-08 13:00:00', 3),
(55, 0, 2, '2012-07-08 17:30:00', 3),
(56, 1, 1, '2012-07-08 15:00:00', 3),
(57, 1, 1, '2012-07-08 17:30:00', 3),
(58, 3, 1, '2012-07-08 11:30:00', 2),
(59, 3, 3, '2012-07-08 18:30:00', 2),
(60, 3, 1, '2012-07-08 19:30:00', 2),
(61, 4, 0, '2012-07-08 11:00:00', 2),
(62, 4, 2, '2012-07-08 16:30:00', 2),
(63, 4, 0, '2012-07-08 18:00:00', 2),
(64, 4, 0, '2012-07-08 19:30:00', 2),
(65, 6, 0, '2012-07-08 14:00:00', 2),
(66, 6, 0, '2012-07-08 18:30:00', 2),
(67, 7, 2, '2012-07-08 11:00:00', 2),
(68, 7, 1, '2012-07-08 16:30:00', 2),
(69, 8, 3, '2012-07-08 10:00:00', 1),
(70, 8, 3, '2012-07-08 16:30:00', 1),
(71, 0, 2, '2012-07-09 12:30:00', 3),
(72, 0, 2, '2012-07-09 15:30:00', 3),
(73, 0, 2, '2012-07-09 19:00:00', 3),
(74, 1, 0, '2012-07-09 13:00:00', 3),
(75, 1, 1, '2012-07-09 19:00:00', 3),
(76, 2, 1, '2012-07-09 09:00:00', 6),
(77, 2, 0, '2012-07-09 19:00:00', 3),
(78, 3, 3, '2012-07-09 17:00:00', 2),
(79, 3, 3, '2012-07-09 18:30:00', 2),
(80, 4, 2, '2012-07-09 11:00:00', 2),
(81, 4, 3, '2012-07-09 14:30:00', 2),
(82, 6, 0, '2012-07-09 14:30:00', 2),
(83, 7, 1, '2012-07-09 15:30:00', 2),
(84, 7, 0, '2012-07-09 18:30:00', 4),
(85, 8, 3, '2012-07-09 09:30:00', 1),
(86, 8, 3, '2012-07-09 16:30:00', 1),
(87, 8, 3, '2012-07-09 20:00:00', 1),
(88, 0, 0, '2012-07-10 11:30:00', 3),
(89, 0, 0, '2012-07-10 16:00:00', 3),
(90, 3, 2, '2012-07-10 08:00:00', 2),
(91, 3, 1, '2012-07-10 11:00:00', 2),
(92, 3, 3, '2012-07-10 15:30:00', 2),
(93, 3, 2, '2012-07-10 16:30:00', 2),
(94, 3, 1, '2012-07-10 18:00:00', 2),
(95, 4, 0, '2012-07-10 10:00:00', 2),
(96, 4, 4, '2012-07-10 11:30:00', 2),
(97, 4, 0, '2012-07-10 15:00:00', 2),
(98, 4, 3, '2012-07-10 17:00:00', 4),
(99, 5, 0, '2012-07-10 08:30:00', 2),
(100, 6, 0, '2012-07-10 14:30:00', 2),
(101, 6, 0, '2012-07-10 19:00:00', 2),
(102, 7, 4, '2012-07-10 08:30:00', 2),
(103, 7, 2, '2012-07-10 17:30:00', 2),
(104, 8, 0, '2012-07-10 11:30:00', 1),
(105, 8, 3, '2012-07-10 12:00:00', 1),
(106, 8, 3, '2012-07-10 19:30:00', 1),
(107, 0, 4, '2012-07-11 08:00:00', 3),
(108, 0, 2, '2012-07-11 10:00:00', 3),
(109, 0, 0, '2012-07-11 12:00:00', 3),
(110, 0, 0, '2012-07-11 14:00:00', 3),
(111, 0, 2, '2012-07-11 15:30:00', 3),
(112, 0, 2, '2012-07-11 18:30:00', 3),
(113, 1, 0, '2012-07-11 12:30:00', 3),
(114, 1, 0, '2012-07-11 16:00:00', 3),
(115, 4, 1, '2012-07-11 08:00:00', 2),
(116, 4, 0, '2012-07-11 09:00:00', 2),
(117, 4, 3, '2012-07-11 11:00:00', 2),
(118, 4, 0, '2012-07-11 15:00:00', 2),
(119, 5, 4, '2012-07-11 17:00:00', 2),
(120, 6, 0, '2012-07-11 14:00:00', 2),
(121, 6, 0, '2012-07-11 19:30:00', 2),
(122, 7, 0, '2012-07-11 08:00:00', 2),
(123, 7, 0, '2012-07-11 14:00:00', 2),
(124, 7, 0, '2012-07-11 16:30:00', 2),
(125, 8, 4, '2012-07-11 11:00:00', 1),
(126, 8, 3, '2012-07-11 13:00:00', 1),
(127, 0, 0, '2012-07-12 13:30:00', 3),
(128, 0, 2, '2012-07-12 16:30:00', 3),
(129, 1, 1, '2012-07-12 11:30:00', 3),
(130, 2, 1, '2012-07-12 09:00:00', 3),
(131, 2, 1, '2012-07-12 18:30:00', 3),
(132, 3, 3, '2012-07-12 18:00:00', 2),
(133, 4, 1, '2012-07-12 16:00:00', 2),
(134, 6, 0, '2012-07-12 12:00:00', 4),
(135, 7, 2, '2012-07-12 08:00:00', 2),
(136, 7, 4, '2012-07-12 13:30:00', 2),
(137, 7, 4, '2012-07-12 16:00:00', 2),
(138, 8, 3, '2012-07-12 16:30:00', 1),
(139, 0, 2, '2012-07-13 10:30:00', 3),
(140, 0, 4, '2012-07-13 14:00:00', 3),
(141, 0, 3, '2012-07-13 17:00:00', 3),
(142, 1, 1, '2012-07-13 15:00:00', 3),
(143, 2, 1, '2012-07-13 09:00:00', 3),
(144, 2, 0, '2012-07-13 15:00:00', 3),
(145, 2, 1, '2012-07-13 16:30:00', 3),
(146, 4, 0, '2012-07-13 11:00:00', 2),
(147, 4, 0, '2012-07-13 13:30:00', 2),
(148, 4, 0, '2012-07-13 15:00:00', 2),
(149, 4, 3, '2012-07-13 16:00:00', 2),
(150, 4, 4, '2012-07-13 17:30:00', 2),
(151, 6, 0, '2012-07-13 09:30:00', 2),
(152, 7, 0, '2012-07-13 08:00:00', 2),
(153, 7, 1, '2012-07-13 11:00:00', 2),
(154, 7, 4, '2012-07-13 12:30:00', 2),
(155, 8, 0, '2012-07-13 15:30:00', 1),
(156, 8, 2, '2012-07-13 18:30:00', 1),
(157, 0, 2, '2012-07-14 08:30:00', 3),
(158, 0, 4, '2012-07-14 11:30:00', 3),
(159, 0, 3, '2012-07-14 15:00:00', 3),
(160, 1, 3, '2012-07-14 10:30:00', 3),
(161, 1, 3, '2012-07-14 12:30:00', 3),
(162, 1, 0, '2012-07-14 14:30:00', 3),
(163, 2, 1, '2012-07-14 08:30:00', 3),
(164, 3, 2, '2012-07-14 16:00:00', 2),
(165, 4, 3, '2012-07-14 08:00:00', 2),
(166, 4, 1, '2012-07-14 14:30:00', 2),
(167, 6, 0, '2012-07-14 09:30:00', 2),
(168, 6, 1, '2012-07-14 12:30:00', 2),
(169, 6, 0, '2012-07-14 15:00:00', 2),
(170, 7, 2, '2012-07-14 12:30:00', 2),
(171, 7, 2, '2012-07-14 15:00:00', 2),
(172, 7, 4, '2012-07-14 16:30:00', 2),
(173, 7, 1, '2012-07-14 19:00:00', 2),
(174, 8, 3, '2012-07-14 09:00:00', 1),
(175, 8, 1, '2012-07-14 17:00:00', 1),
(176, 0, 2, '2012-07-15 08:00:00', 3),
(177, 0, 0, '2012-07-15 16:00:00', 3),
(178, 0, 2, '2012-07-15 19:00:00', 3),
(179, 1, 0, '2012-07-15 10:00:00', 3),
(180, 1, 0, '2012-07-15 12:00:00', 3),
(181, 1, 3, '2012-07-15 15:30:00', 3),
(182, 2, 1, '2012-07-15 13:00:00', 3),
(183, 3, 1, '2012-07-15 17:30:00', 2),
(184, 4, 3, '2012-07-15 11:30:00', 2),
(185, 4, 0, '2012-07-15 15:00:00', 2),
(186, 4, 3, '2012-07-15 17:30:00', 2),
(187, 7, 4, '2012-07-15 14:30:00', 2),
(188, 7, 4, '2012-07-15 17:00:00', 2),
(189, 8, 4, '2012-07-15 10:00:00', 1),
(190, 8, 2, '2012-07-15 12:00:00', 1),
(191, 8, 3, '2012-07-15 12:30:00', 1),
(192, 8, 3, '2012-07-15 13:30:00', 1),
(193, 0, 5, '2012-07-16 11:00:00', 3),
(194, 0, 5, '2012-07-16 19:00:00', 3),
(195, 1, 1, '2012-07-16 08:00:00', 3),
(196, 1, 0, '2012-07-16 12:30:00', 3),
(197, 2, 1, '2012-07-16 16:30:00', 3),
(198, 4, 3, '2012-07-16 09:00:00', 2),
(199, 4, 1, '2012-07-16 11:00:00', 2),
(200, 4, 3, '2012-07-16 12:00:00', 2),
(201, 4, 3, '2012-07-16 17:30:00', 2),
(202, 6, 0, '2012-07-16 18:30:00', 2),
(203, 7, 4, '2012-07-16 08:00:00', 2),
(204, 7, 2, '2012-07-16 11:30:00', 2),
(205, 7, 4, '2012-07-16 12:30:00', 2),
(206, 7, 5, '2012-07-16 14:00:00', 2),
(207, 8, 4, '2012-07-16 12:00:00', 1),
(208, 8, 1, '2012-07-16 15:00:00', 1),
(209, 8, 4, '2012-07-16 18:00:00', 1),
(210, 8, 3, '2012-07-16 19:30:00', 1),
(211, 0, 5, '2012-07-17 12:30:00', 3),
(212, 0, 5, '2012-07-17 18:00:00', 3),
(213, 1, 1, '2012-07-17 10:00:00', 3),
(214, 1, 4, '2012-07-17 14:30:00', 3),
(215, 2, 5, '2012-07-17 10:30:00', 3),
(216, 2, 1, '2012-07-17 12:30:00', 3),
(217, 2, 1, '2012-07-17 15:30:00', 3),
(218, 2, 2, '2012-07-17 19:00:00', 3),
(219, 3, 1, '2012-07-17 14:00:00', 2),
(220, 3, 2, '2012-07-17 15:00:00', 2),
(221, 4, 0, '2012-07-17 09:00:00', 2),
(222, 4, 3, '2012-07-17 10:30:00', 2),
(223, 4, 3, '2012-07-17 12:00:00', 2),
(224, 4, 5, '2012-07-17 16:00:00', 2),
(225, 4, 3, '2012-07-17 18:30:00', 2),
(226, 5, 0, '2012-07-17 13:30:00', 2),
(227, 6, 4, '2012-07-17 12:00:00', 2),
(228, 6, 0, '2012-07-17 14:00:00', 2),
(229, 7, 4, '2012-07-17 08:00:00', 2),
(230, 7, 5, '2012-07-17 14:00:00', 2),
(231, 7, 4, '2012-07-17 16:00:00', 2),
(232, 8, 3, '2012-07-17 08:30:00', 1),
(233, 8, 2, '2012-07-17 11:00:00', 1),
(234, 8, 3, '2012-07-17 11:30:00', 1),
(235, 8, 3, '2012-07-17 14:30:00', 1),
(236, 8, 0, '2012-07-17 15:00:00', 1),
(237, 8, 3, '2012-07-17 15:30:00', 1),
(238, 8, 3, '2012-07-17 18:00:00', 1),
(239, 8, 3, '2012-07-17 20:00:00', 1),
(240, 0, 5, '2012-07-18 13:00:00', 3),
(241, 0, 5, '2012-07-18 17:30:00', 3),
(242, 1, 0, '2012-07-18 14:00:00', 3),
(243, 1, 0, '2012-07-18 16:30:00', 3),
(244, 2, 1, '2012-07-18 14:00:00', 3),
(245, 3, 2, '2012-07-18 11:30:00', 2),
(246, 3, 3, '2012-07-18 19:00:00', 2),
(247, 4, 1, '2012-07-18 08:30:00', 2),
(248, 4, 4, '2012-07-18 10:00:00', 2),
(249, 4, 5, '2012-07-18 19:00:00', 2),
(250, 5, 0, '2012-07-18 14:30:00', 2),
(251, 6, 0, '2012-07-18 10:30:00', 2),
(252, 6, 0, '2012-07-18 13:00:00', 2),
(253, 6, 0, '2012-07-18 15:00:00', 2),
(254, 6, 1, '2012-07-18 19:30:00', 2),
(255, 7, 4, '2012-07-18 08:30:00', 2),
(256, 7, 4, '2012-07-18 11:00:00', 2),
(257, 8, 3, '2012-07-18 11:00:00', 1),
(258, 8, 0, '2012-07-18 13:00:00', 1),
(259, 8, 3, '2012-07-18 14:30:00', 1),
(260, 8, 4, '2012-07-18 16:00:00', 1),
(261, 8, 3, '2012-07-18 16:30:00', 1),
(262, 8, 4, '2012-07-18 20:00:00', 1),
(263, 0, 2, '2012-07-19 08:30:00', 3),
(264, 0, 4, '2012-07-19 10:30:00', 3),
(265, 0, 5, '2012-07-19 12:00:00', 3),
(266, 0, 0, '2012-07-19 13:30:00', 3),
(267, 0, 5, '2012-07-19 16:30:00', 3),
(268, 1, 1, '2012-07-19 11:30:00', 3),
(269, 1, 0, '2012-07-19 15:00:00', 3),
(270, 1, 0, '2012-07-19 18:30:00', 3),
(271, 2, 1, '2012-07-19 09:30:00', 3),
(272, 2, 0, '2012-07-19 11:30:00', 3),
(273, 2, 1, '2012-07-19 14:30:00', 3),
(274, 2, 2, '2012-07-19 16:00:00', 3),
(275, 3, 3, '2012-07-19 08:30:00', 2),
(276, 3, 3, '2012-07-19 17:00:00', 2),
(277, 3, 3, '2012-07-19 18:30:00', 2),
(278, 4, 3, '2012-07-19 12:00:00', 2),
(279, 4, 5, '2012-07-19 14:30:00', 2),
(280, 4, 0, '2012-07-19 16:30:00', 2),
(281, 4, 1, '2012-07-19 18:30:00', 2),
(282, 4, 0, '2012-07-19 19:30:00', 2),
(283, 5, 0, '2012-07-19 08:30:00', 2),
(284, 6, 4, '2012-07-19 12:30:00', 2),
(285, 6, 2, '2012-07-19 14:00:00', 2),
(286, 6, 0, '2012-07-19 15:00:00', 2),
(287, 6, 0, '2012-07-19 16:30:00', 2),
(288, 7, 2, '2012-07-19 13:00:00', 2),
(289, 7, 0, '2012-07-19 14:00:00', 2),
(290, 7, 0, '2012-07-19 16:30:00', 2),
(291, 7, 4, '2012-07-19 17:30:00', 4),
(292, 8, 3, '2012-07-19 11:00:00', 1),
(293, 8, 1, '2012-07-19 13:30:00', 1),
(294, 8, 3, '2012-07-19 14:30:00', 1),
(295, 8, 3, '2012-07-19 18:00:00', 1),
(296, 8, 3, '2012-07-19 20:00:00', 1),
(297, 0, 3, '2012-07-20 08:00:00', 3),
(298, 0, 5, '2012-07-20 12:00:00', 3),
(299, 0, 5, '2012-07-20 14:00:00', 3),
(300, 0, 5, '2012-07-20 17:30:00', 3),
(301, 0, 0, '2012-07-20 19:00:00', 3),
(302, 1, 2, '2012-07-20 08:30:00', 3),
(303, 1, 3, '2012-07-20 12:00:00', 3),
(304, 1, 4, '2012-07-20 13:30:00', 3),
(305, 2, 1, '2012-07-20 14:30:00', 3),
(306, 3, 3, '2012-07-20 15:00:00', 2),
(307, 3, 1, '2012-07-20 17:30:00', 2),
(308, 4, 5, '2012-07-20 08:00:00', 2),
(309, 4, 0, '2012-07-20 13:00:00', 2),
(310, 4, 1, '2012-07-20 16:30:00', 2),
(311, 4, 0, '2012-07-20 17:30:00', 2),
(312, 4, 3, '2012-07-20 18:30:00', 2),
(313, 6, 0, '2012-07-20 11:00:00', 2),
(314, 6, 4, '2012-07-20 12:30:00', 2),
(315, 6, 2, '2012-07-20 15:00:00', 2),
(316, 6, 0, '2012-07-20 16:00:00', 4),
(317, 7, 2, '2012-07-20 12:30:00', 2),
(318, 7, 2, '2012-07-20 16:00:00', 2),
(319, 7, 4, '2012-07-20 19:30:00', 2),
(320, 8, 1, '2012-07-20 09:00:00', 1),
(321, 8, 2, '2012-07-20 12:00:00', 1),
(322, 8, 3, '2012-07-20 19:30:00', 1),
(323, 0, 0, '2012-07-21 08:00:00', 3),
(324, 0, 5, '2012-07-21 11:00:00', 3),
(325, 0, 5, '2012-07-21 13:30:00', 3),
(326, 0, 4, '2012-07-21 15:30:00', 3),
(327, 1, 1, '2012-07-21 09:30:00', 3),
(328, 1, 0, '2012-07-21 11:00:00', 3),
(329, 2, 0, '2012-07-21 10:30:00', 3),
(330, 2, 1, '2012-07-21 13:30:00', 3),
(331, 3, 2, '2012-07-21 08:00:00', 2),
(332, 4, 0, '2012-07-21 09:00:00', 2),
(333, 4, 3, '2012-07-21 10:30:00', 2),
(334, 4, 0, '2012-07-21 14:00:00', 4),
(335, 4, 3, '2012-07-21 16:00:00', 2),
(336, 4, 1, '2012-07-21 17:00:00', 2),
(337, 4, 0, '2012-07-21 19:00:00', 2),
(338, 6, 4, '2012-07-21 08:00:00', 2),
(339, 6, 0, '2012-07-21 09:30:00', 2),
(340, 6, 0, '2012-07-21 12:00:00', 2),
(341, 8, 3, '2012-07-21 09:30:00', 1),
(342, 8, 3, '2012-07-21 11:30:00', 1),
(343, 8, 3, '2012-07-21 18:00:00', 2),
(344, 8, 3, '2012-07-21 19:30:00', 1),
(345, 0, 5, '2012-07-22 10:00:00', 3),
(346, 0, 0, '2012-07-22 16:00:00', 3),
(347, 0, 2, '2012-07-22 18:00:00', 3),
(348, 1, 0, '2012-07-22 08:30:00', 3),
(349, 1, 0, '2012-07-22 10:30:00', 3),
(350, 1, 5, '2012-07-22 18:30:00', 3),
(351, 2, 1, '2012-07-22 08:30:00', 3),
(352, 2, 1, '2012-07-22 13:30:00', 3),
(353, 2, 1, '2012-07-22 16:30:00', 3),
(354, 3, 3, '2012-07-22 11:30:00', 2),
(355, 3, 2, '2012-07-22 14:00:00', 2),
(356, 4, 4, '2012-07-22 08:00:00', 2),
(357, 4, 3, '2012-07-22 10:30:00', 2),
(358, 4, 0, '2012-07-22 12:00:00', 2),
(359, 4, 5, '2012-07-22 13:00:00', 2),
(360, 4, 0, '2012-07-22 16:30:00', 2),
(361, 4, 1, '2012-07-22 18:00:00', 2),
(362, 4, 3, '2012-07-22 19:30:00', 2),
(363, 6, 4, '2012-07-22 10:30:00', 4),
(364, 6, 0, '2012-07-22 14:30:00', 2),
(365, 6, 0, '2012-07-22 16:30:00', 2),
(366, 7, 2, '2012-07-22 10:30:00', 2),
(367, 7, 2, '2012-07-22 12:00:00', 2),
(368, 8, 3, '2012-07-22 16:00:00', 1),
(369, 8, 3, '2012-07-22 17:00:00', 1),
(370, 8, 2, '2012-07-22 17:30:00', 1),
(371, 0, 0, '2012-07-23 09:30:00', 3),
(372, 0, 0, '2012-07-23 12:00:00', 3),
(373, 0, 5, '2012-07-23 17:00:00', 3),
(374, 1, 1, '2012-07-23 10:00:00', 3),
(375, 1, 4, '2012-07-23 12:30:00', 3),
(376, 1, 4, '2012-07-23 15:30:00', 3),
(377, 1, 0, '2012-07-23 17:00:00', 3),
(378, 1, 4, '2012-07-23 19:00:00', 3),
(379, 2, 1, '2012-07-23 08:00:00', 3),
(380, 2, 5, '2012-07-23 11:30:00', 3),
(381, 2, 1, '2012-07-23 13:00:00', 3),
(382, 2, 1, '2012-07-23 15:00:00', 3),
(383, 3, 2, '2012-07-23 09:30:00', 2),
(384, 3, 2, '2012-07-23 19:00:00', 2),
(385, 4, 4, '2012-07-23 10:00:00', 2),
(386, 4, 0, '2012-07-23 16:30:00', 2),
(387, 4, 3, '2012-07-23 19:00:00', 2),
(388, 5, 3, '2012-07-23 13:00:00', 2),
(389, 6, 0, '2012-07-23 13:30:00', 2),
(390, 6, 0, '2012-07-23 15:00:00', 4),
(391, 6, 0, '2012-07-23 19:00:00', 2),
(392, 7, 5, '2012-07-23 16:00:00', 2),
(393, 7, 4, '2012-07-23 18:00:00', 2),
(394, 8, 3, '2012-07-23 08:30:00', 3),
(395, 8, 3, '2012-07-23 11:00:00', 1),
(396, 8, 3, '2012-07-23 14:00:00', 2),
(397, 8, 2, '2012-07-23 15:00:00', 1),
(398, 0, 0, '2012-07-24 11:00:00', 3),
(399, 0, 4, '2012-07-24 13:00:00', 3),
(400, 0, 5, '2012-07-24 14:30:00', 3),
(401, 1, 4, '2012-07-24 11:00:00', 3),
(402, 1, 0, '2012-07-24 16:00:00', 6),
(403, 1, 1, '2012-07-24 19:00:00', 3),
(404, 2, 1, '2012-07-24 09:00:00', 3),
(405, 2, 2, '2012-07-24 12:30:00', 3),
(406, 3, 3, '2012-07-24 09:00:00', 2),
(407, 3, 3, '2012-07-24 17:30:00', 2),
(408, 4, 0, '2012-07-24 08:30:00', 2),
(409, 4, 5, '2012-07-24 09:30:00', 2),
(410, 4, 0, '2012-07-24 11:30:00', 2),
(411, 4, 1, '2012-07-24 14:30:00', 2),
(412, 4, 0, '2012-07-24 15:30:00', 2),
(413, 4, 0, '2012-07-24 17:30:00', 2),
(414, 4, 0, '2012-07-24 19:30:00', 2),
(415, 5, 5, '2012-07-24 16:30:00', 2),
(416, 6, 0, '2012-07-24 09:30:00', 2),
(417, 6, 0, '2012-07-24 14:30:00', 2),
(418, 7, 4, '2012-07-24 09:30:00', 2),
(419, 7, 5, '2012-07-24 11:30:00', 2),
(420, 7, 2, '2012-07-24 16:30:00', 2),
(421, 7, 4, '2012-07-24 18:00:00', 2),
(422, 7, 2, '2012-07-24 19:30:00', 2),
(423, 8, 3, '2012-07-24 08:30:00', 1),
(424, 8, 3, '2012-07-24 10:30:00', 2),
(425, 8, 3, '2012-07-24 12:00:00', 1),
(426, 8, 3, '2012-07-24 14:00:00', 1),
(427, 8, 0, '2012-07-24 15:00:00', 1),
(428, 8, 4, '2012-07-24 16:30:00', 1),
(429, 8, 0, '2012-07-24 20:00:00', 1),
(430, 0, 5, '2012-07-25 08:00:00', 3),
(431, 0, 0, '2012-07-25 12:30:00', 3),
(432, 0, 0, '2012-07-25 16:30:00', 3),
(433, 1, 1, '2012-07-25 08:00:00', 3),
(434, 1, 0, '2012-07-25 10:30:00', 3),
(435, 1, 4, '2012-07-25 15:00:00', 3),
(436, 2, 1, '2012-07-25 13:30:00', 3),
(437, 2, 1, '2012-07-25 17:30:00', 3),
(438, 3, 2, '2012-07-25 10:00:00', 2),
(439, 3, 3, '2012-07-25 14:00:00', 4),
(440, 3, 3, '2012-07-25 17:00:00', 2),
(441, 3, 2, '2012-07-25 18:30:00', 2),
(442, 4, 3, '2012-07-25 08:30:00', 2),
(443, 4, 0, '2012-07-25 09:30:00', 4),
(444, 4, 3, '2012-07-25 11:30:00', 4),
(445, 4, 5, '2012-07-25 13:30:00', 4),
(446, 4, 3, '2012-07-25 16:00:00', 2),
(447, 4, 3, '2012-07-25 18:00:00', 2),
(448, 4, 3, '2012-07-25 19:30:00', 2),
(449, 5, 0, '2012-07-25 18:30:00', 2),
(450, 6, 4, '2012-07-25 08:30:00', 2),
(451, 6, 1, '2012-07-25 09:30:00', 2),
(452, 6, 0, '2012-07-25 12:00:00', 2),
(453, 6, 0, '2012-07-25 13:30:00', 2),
(454, 6, 0, '2012-07-25 16:30:00', 4),
(455, 6, 5, '2012-07-25 19:00:00', 2),
(456, 7, 5, '2012-07-25 10:30:00', 2),
(457, 7, 2, '2012-07-25 14:00:00', 2),
(458, 7, 2, '2012-07-25 16:00:00', 2),
(459, 8, 3, '2012-07-25 08:00:00', 1),
(460, 8, 3, '2012-07-25 10:00:00', 1),
(461, 8, 4, '2012-07-25 14:30:00', 1),
(462, 8, 1, '2012-07-25 16:00:00', 1),
(463, 8, 2, '2012-07-25 20:00:00', 1),
(464, 0, 4, '2012-07-26 09:00:00', 3),
(465, 0, 0, '2012-07-26 11:30:00', 3),
(466, 0, 4, '2012-07-26 18:00:00', 3),
(467, 1, 8, '2012-07-26 08:00:00', 3),
(468, 1, 8, '2012-07-26 11:30:00', 3),
(469, 1, 8, '2012-07-26 13:30:00', 3),
(470, 1, 1, '2012-07-26 15:00:00', 3),
(471, 1, 0, '2012-07-26 16:30:00', 3),
(472, 1, 6, '2012-07-26 19:00:00', 3),
(473, 2, 1, '2012-07-26 08:30:00', 3),
(474, 2, 2, '2012-07-26 11:00:00', 6),
(475, 2, 7, '2012-07-26 14:00:00', 3),
(476, 2, 2, '2012-07-26 17:00:00', 3),
(477, 2, 3, '2012-07-26 19:00:00', 3),
(478, 3, 0, '2012-07-26 09:00:00', 2),
(479, 3, 0, '2012-07-26 13:30:00', 2),
(480, 3, 3, '2012-07-26 16:00:00', 2),
(481, 4, 3, '2012-07-26 08:00:00', 2),
(482, 4, 6, '2012-07-26 09:00:00', 2),
(483, 4, 0, '2012-07-26 12:00:00', 2),
(484, 4, 5, '2012-07-26 13:30:00', 2),
(485, 4, 6, '2012-07-26 16:00:00', 2),
(486, 4, 7, '2012-07-26 17:30:00', 2),
(487, 6, 0, '2012-07-26 10:00:00', 4),
(488, 6, 0, '2012-07-26 13:00:00', 2),
(489, 6, 0, '2012-07-26 19:00:00', 2),
(490, 7, 7, '2012-07-26 09:30:00', 2),
(491, 7, 6, '2012-07-26 11:00:00', 2),
(492, 7, 5, '2012-07-26 12:30:00', 2),
(493, 7, 4, '2012-07-26 13:30:00', 2),
(494, 7, 5, '2012-07-26 17:00:00', 2),
(495, 8, 3, '2012-07-26 12:00:00', 1),
(496, 8, 3, '2012-07-26 13:30:00', 1),
(497, 8, 2, '2012-07-26 15:00:00', 1),
(498, 8, 1, '2012-07-26 16:30:00', 1),
(499, 8, 3, '2012-07-26 17:00:00', 1),
(500, 0, 4, '2012-07-27 08:00:00', 3),
(501, 0, 5, '2012-07-27 11:00:00', 3),
(502, 0, 6, '2012-07-27 14:00:00', 3),
(503, 0, 6, '2012-07-27 17:30:00', 3),
(504, 1, 0, '2012-07-27 10:00:00', 3),
(505, 1, 7, '2012-07-27 11:30:00', 3),
(506, 1, 0, '2012-07-27 13:00:00', 3),
(507, 1, 0, '2012-07-27 15:00:00', 3),
(508, 1, 0, '2012-07-27 18:00:00', 3),
(509, 2, 1, '2012-07-27 12:00:00', 6),
(510, 3, 0, '2012-07-27 10:30:00', 2),
(511, 3, 2, '2012-07-27 14:00:00', 2),
(512, 3, 3, '2012-07-27 19:00:00', 2),
(513, 4, 1, '2012-07-27 10:00:00', 4),
(514, 4, 6, '2012-07-27 12:30:00', 2),
(515, 4, 0, '2012-07-27 14:00:00', 4),
(516, 4, 0, '2012-07-27 16:30:00', 2),
(517, 4, 1, '2012-07-27 17:30:00', 2),
(518, 4, 0, '2012-07-27 18:30:00', 2),
(519, 5, 7, '2012-07-27 18:00:00', 2),
(520, 6, 0, '2012-07-27 09:00:00', 2),
(521, 6, 5, '2012-07-27 14:00:00', 2),
(522, 6, 8, '2012-07-27 16:30:00', 2),
(523, 7, 2, '2012-07-27 18:00:00', 2),
(524, 7, 4, '2012-07-27 19:00:00', 2),
(525, 8, 3, '2012-07-27 09:00:00', 1),
(526, 8, 3, '2012-07-27 12:30:00', 1),
(527, 8, 3, '2012-07-27 16:00:00', 1),
(528, 8, 6, '2012-07-27 16:30:00', 1),
(529, 8, 0, '2012-07-27 18:30:00', 1),
(530, 0, 7, '2012-07-28 08:00:00', 9),
(531, 0, 4, '2012-07-28 13:00:00', 3),
(532, 0, 5, '2012-07-28 15:00:00', 3),
(533, 0, 2, '2012-07-28 19:00:00', 3),
(534, 1, 1, '2012-07-28 08:00:00', 3),
(535, 1, 0, '2012-07-28 10:00:00', 3),
(536, 1, 0, '2012-07-28 16:00:00', 3),
(537, 1, 7, '2012-07-28 17:30:00', 3),
(538, 2, 1, '2012-07-28 10:00:00', 3),
(539, 2, 1, '2012-07-28 14:00:00', 3),
(540, 2, 1, '2012-07-28 17:00:00', 3),
(541, 2, 5, '2012-07-28 18:30:00', 3),
(542, 3, 3, '2012-07-28 08:30:00', 2),
(543, 3, 3, '2012-07-28 15:30:00', 2),
(544, 4, 0, '2012-07-28 09:00:00', 2),
(545, 4, 3, '2012-07-28 10:30:00', 4),
(546, 4, 0, '2012-07-28 12:30:00', 2),
(547, 4, 8, '2012-07-28 16:00:00', 2),
(548, 4, 0, '2012-07-28 19:00:00', 2),
(549, 5, 0, '2012-07-28 18:00:00', 2),
(550, 6, 0, '2012-07-28 17:00:00', 2),
(551, 6, 0, '2012-07-28 18:30:00', 2),
(552, 7, 2, '2012-07-28 09:00:00', 2),
(553, 7, 5, '2012-07-28 10:00:00', 2),
(554, 7, 6, '2012-07-28 12:30:00', 2),
(555, 7, 8, '2012-07-28 17:00:00', 4),
(556, 8, 2, '2012-07-28 16:00:00', 1),
(557, 8, 3, '2012-07-28 16:30:00', 1),
(558, 8, 4, '2012-07-28 19:00:00', 1),
(559, 0, 7, '2012-07-29 09:30:00', 3),
(560, 0, 2, '2012-07-29 11:00:00', 3),
(561, 0, 6, '2012-07-29 13:00:00', 3),
(562, 0, 5, '2012-07-29 15:00:00', 3),
(563, 0, 0, '2012-07-29 17:00:00', 3),
(564, 1, 8, '2012-07-29 09:30:00', 3),
(565, 1, 0, '2012-07-29 15:00:00', 3),
(566, 1, 8, '2012-07-29 16:30:00', 3),
(567, 2, 1, '2012-07-29 08:30:00', 3),
(568, 2, 1, '2012-07-29 12:00:00', 6),
(569, 2, 1, '2012-07-29 15:30:00', 3),
(570, 4, 3, '2012-07-29 08:00:00', 2),
(571, 4, 0, '2012-07-29 09:00:00', 2),
(572, 4, 3, '2012-07-29 10:30:00', 2),
(573, 4, 8, '2012-07-29 11:30:00', 4),
(574, 4, 8, '2012-07-29 15:00:00', 2),
(575, 4, 0, '2012-07-29 18:30:00', 2),
(576, 6, 0, '2012-07-29 09:00:00', 2),
(577, 6, 0, '2012-07-29 10:30:00', 2),
(578, 6, 6, '2012-07-29 17:30:00', 4),
(579, 7, 4, '2012-07-29 16:00:00', 2),
(580, 7, 8, '2012-07-29 18:30:00', 2),
(581, 8, 3, '2012-07-29 12:30:00', 1),
(582, 8, 7, '2012-07-29 13:00:00', 1),
(583, 8, 3, '2012-07-29 15:30:00', 1),
(584, 8, 3, '2012-07-29 18:00:00', 1),
(585, 0, 5, '2012-07-30 14:00:00', 3),
(586, 0, 6, '2012-07-30 15:30:00', 3),
(587, 0, 7, '2012-07-30 19:00:00', 3),
(588, 1, 8, '2012-07-30 08:30:00', 3),
(589, 1, 7, '2012-07-30 11:00:00', 3),
(590, 1, 2, '2012-07-30 13:30:00', 3),
(591, 1, 1, '2012-07-30 15:30:00', 3),
(592, 2, 5, '2012-07-30 10:00:00', 3),
(593, 2, 8, '2012-07-30 11:30:00', 3),
(594, 2, 7, '2012-07-30 15:00:00', 3),
(595, 2, 0, '2012-07-30 17:30:00', 3),
(596, 3, 3, '2012-07-30 11:30:00', 2),
(597, 3, 4, '2012-07-30 16:30:00', 2),
(598, 4, 0, '2012-07-30 08:00:00', 2),
(599, 4, 0, '2012-07-30 10:30:00', 2),
(600, 4, 0, '2012-07-30 12:00:00', 2),
(601, 4, 7, '2012-07-30 18:00:00', 2),
(602, 4, 3, '2012-07-30 19:30:00', 2),
(603, 5, 0, '2012-07-30 12:30:00', 2),
(604, 5, 0, '2012-07-30 14:00:00', 2),
(605, 6, 0, '2012-07-30 08:30:00', 2),
(606, 6, 0, '2012-07-30 12:00:00', 2),
(607, 6, 0, '2012-07-30 14:30:00', 2),
(608, 6, 0, '2012-07-30 17:30:00', 2),
(609, 7, 7, '2012-07-30 08:00:00', 2),
(610, 7, 6, '2012-07-30 09:30:00', 2),
(611, 7, 8, '2012-07-30 14:30:00', 2),
(612, 7, 5, '2012-07-30 16:30:00', 2),
(613, 7, 4, '2012-07-30 18:00:00', 2),
(614, 7, 6, '2012-07-30 19:00:00', 2),
(615, 8, 3, '2012-07-30 08:30:00', 1),
(616, 8, 2, '2012-07-30 09:00:00', 1),
(617, 8, 2, '2012-07-30 11:00:00', 1),
(618, 8, 2, '2012-07-30 12:30:00', 1),
(619, 8, 3, '2012-07-30 15:00:00', 2),
(620, 8, 5, '2012-07-30 16:00:00', 1),
(621, 8, 2, '2012-07-30 16:30:00', 1),
(622, 8, 3, '2012-07-30 18:30:00', 1),
(623, 8, 1, '2012-07-30 19:30:00', 1),
(624, 0, 7, '2012-07-31 09:30:00', 3),
(625, 0, 0, '2012-07-31 11:00:00', 3),
(626, 0, 0, '2012-07-31 15:00:00', 3),
(627, 0, 5, '2012-07-31 17:00:00', 3),
(628, 0, 0, '2012-07-31 18:30:00', 3),
(629, 1, 0, '2012-07-31 08:00:00', 3),
(630, 1, 7, '2012-07-31 13:00:00', 3),
(631, 2, 1, '2012-07-31 16:30:00', 3),
(632, 3, 3, '2012-07-31 08:30:00', 2),
(633, 3, 1, '2012-07-31 13:00:00', 2),
(634, 3, 1, '2012-07-31 15:30:00', 2),
(635, 4, 8, '2012-07-31 09:30:00', 2),
(636, 4, 0, '2012-07-31 11:00:00', 2),
(637, 4, 3, '2012-07-31 12:00:00', 2),
(638, 4, 2, '2012-07-31 13:00:00', 2),
(639, 4, 3, '2012-07-31 14:00:00', 2),
(640, 4, 0, '2012-07-31 15:00:00', 2),
(641, 4, 6, '2012-07-31 17:00:00', 2),
(642, 4, 7, '2012-07-31 18:30:00', 2),
(643, 4, 0, '2012-07-31 19:30:00', 2),
(644, 6, 0, '2012-07-31 09:00:00', 2),
(645, 6, 5, '2012-07-31 10:00:00', 2),
(646, 6, 6, '2012-07-31 11:00:00', 2),
(647, 6, 0, '2012-07-31 14:30:00', 2),
(648, 6, 6, '2012-07-31 16:00:00', 2),
(649, 7, 4, '2012-07-31 18:30:00', 2),
(650, 8, 3, '2012-07-31 10:00:00', 1),
(651, 8, 3, '2012-07-31 11:30:00', 1),
(652, 8, 5, '2012-07-31 12:00:00', 1),
(653, 8, 7, '2012-07-31 12:30:00', 1),
(654, 8, 8, '2012-07-31 13:30:00', 1),
(655, 8, 6, '2012-07-31 14:00:00', 1),
(656, 8, 4, '2012-07-31 17:00:00', 1),
(657, 8, 2, '2012-07-31 17:30:00', 1),
(658, 0, 5, '2012-08-01 15:30:00', 3),
(659, 0, 5, '2012-08-01 18:00:00', 3),
(660, 1, 8, '2012-08-01 09:00:00', 9),
(661, 1, 8, '2012-08-01 17:30:00', 3),
(662, 2, 1, '2012-08-01 09:30:00', 6),
(663, 2, 1, '2012-08-01 14:30:00', 3),
(664, 2, 1, '2012-08-01 16:30:00', 3),
(665, 3, 7, '2012-08-01 13:00:00', 2),
(666, 4, 5, '2012-08-01 08:00:00', 2),
(667, 4, 6, '2012-08-01 09:00:00', 2),
(668, 4, 0, '2012-08-01 10:30:00', 6),
(669, 4, 3, '2012-08-01 13:30:00', 4),
(670, 4, 3, '2012-08-01 19:30:00', 2),
(671, 5, 7, '2012-08-01 08:30:00', 2),
(672, 5, 0, '2012-08-01 14:30:00', 2),
(673, 6, 0, '2012-08-01 09:30:00', 2),
(674, 6, 0, '2012-08-01 11:00:00', 4),
(675, 6, 6, '2012-08-01 14:30:00', 2),
(676, 6, 0, '2012-08-01 18:00:00', 2),
(677, 7, 4, '2012-08-01 12:30:00', 2),
(678, 7, 2, '2012-08-01 16:00:00', 2),
(679, 7, 5, '2012-08-01 17:00:00', 2),
(680, 8, 3, '2012-08-01 08:30:00', 2),
(681, 8, 2, '2012-08-01 09:30:00', 1),
(682, 8, 3, '2012-08-01 10:30:00', 1),
(683, 8, 3, '2012-08-01 11:30:00', 1),
(684, 8, 8, '2012-08-01 13:30:00', 1),
(685, 8, 8, '2012-08-01 15:00:00', 1),
(686, 8, 3, '2012-08-01 17:00:00', 1),
(687, 0, 8, '2012-08-02 08:00:00', 3),
(688, 0, 5, '2012-08-02 13:00:00', 3),
(689, 0, 7, '2012-08-02 15:30:00', 3),
(690, 0, 5, '2012-08-02 18:30:00', 3),
(691, 1, 8, '2012-08-02 09:30:00', 3),
(692, 1, 8, '2012-08-02 12:00:00', 3),
(693, 1, 0, '2012-08-02 13:30:00', 3),
(694, 1, 5, '2012-08-02 15:30:00', 3),
(695, 1, 0, '2012-08-02 18:00:00', 3),
(696, 2, 1, '2012-08-02 09:30:00', 3),
(697, 2, 0, '2012-08-02 11:30:00', 3),
(698, 2, 3, '2012-08-02 14:00:00', 3),
(699, 2, 1, '2012-08-02 19:00:00', 3),
(700, 3, 3, '2012-08-02 10:00:00', 2),
(701, 3, 2, '2012-08-02 15:00:00', 2),
(702, 3, 3, '2012-08-02 17:00:00', 2),
(703, 3, 6, '2012-08-02 18:00:00', 2),
(704, 3, 4, '2012-08-02 19:30:00', 2),
(705, 4, 4, '2012-08-02 10:00:00', 2),
(706, 4, 7, '2012-08-02 11:30:00', 2),
(707, 4, 5, '2012-08-02 14:30:00', 2),
(708, 4, 8, '2012-08-02 15:30:00', 2),
(709, 4, 8, '2012-08-02 17:00:00', 2),
(710, 4, 3, '2012-08-02 18:30:00', 2),
(711, 4, 0, '2012-08-02 19:30:00', 2),
(712, 6, 4, '2012-08-02 09:00:00', 2),
(713, 6, 0, '2012-08-02 10:00:00', 2),
(714, 6, 0, '2012-08-02 11:30:00', 2),
(715, 6, 6, '2012-08-02 12:30:00', 2),
(716, 6, 8, '2012-08-02 14:00:00', 2),
(717, 6, 0, '2012-08-02 17:00:00', 4),
(718, 6, 2, '2012-08-02 19:30:00', 2),
(719, 7, 7, '2012-08-02 08:00:00', 2),
(720, 7, 5, '2012-08-02 11:00:00', 2),
(721, 7, 6, '2012-08-02 14:00:00', 2),
(722, 7, 4, '2012-08-02 16:00:00', 2),
(723, 7, 0, '2012-08-02 18:00:00', 2),
(724, 8, 3, '2012-08-02 08:30:00', 1),
(725, 8, 3, '2012-08-02 13:00:00', 1),
(726, 8, 7, '2012-08-02 15:00:00', 1),
(727, 8, 3, '2012-08-02 16:30:00', 1),
(728, 8, 7, '2012-08-02 17:00:00', 1),
(729, 8, 3, '2012-08-02 19:30:00', 1),
(730, 0, 5, '2012-08-03 11:30:00', 3),
(731, 0, 0, '2012-08-03 16:00:00', 3),
(732, 0, 6, '2012-08-03 18:30:00', 3),
(733, 1, 8, '2012-08-03 10:30:00', 3),
(734, 1, 0, '2012-08-03 13:00:00', 6),
(735, 1, 7, '2012-08-03 1
Download .txt
gitextract_2t_sjv5p/

├── .github/
│   └── workflows/
│       ├── tests.yaml
│       └── wheels.yaml
├── .gitignore
├── .readthedocs.yaml
├── .travis.yml
├── .travis_deps.sh
├── CHANGELOG.md
├── LICENSE
├── MANIFEST.in
├── README.rst
├── bench.py
├── docs/
│   ├── Makefile
│   ├── _themes/
│   │   └── flask/
│   │       ├── layout.html
│   │       ├── relations.html
│   │       ├── static/
│   │       │   ├── flasky.css_t
│   │       │   └── small_flask.css
│   │       └── theme.conf
│   ├── clubdata.sql
│   ├── conf.py
│   ├── index.rst
│   ├── make.bat
│   ├── peewee/
│   │   ├── api.rst
│   │   ├── asyncio.rst
│   │   ├── contributing.rst
│   │   ├── database.rst
│   │   ├── db_tools.rst
│   │   ├── example.rst
│   │   ├── framework_integration.rst
│   │   ├── installation.rst
│   │   ├── interactive.rst
│   │   ├── models.rst
│   │   ├── mysql.rst
│   │   ├── orm_utils.rst
│   │   ├── pool-snippet.rst
│   │   ├── postgres.rst
│   │   ├── query_builder.rst
│   │   ├── query_library.rst
│   │   ├── query_operators.rst
│   │   ├── querying.rst
│   │   ├── quickstart.rst
│   │   ├── recipes.rst
│   │   ├── relationships.rst
│   │   ├── schema.rst
│   │   ├── sqlite.rst
│   │   ├── transactions.rst
│   │   └── writing.rst
│   └── requirements.txt
├── examples/
│   ├── adjacency_list.py
│   ├── analytics/
│   │   ├── app.py
│   │   ├── reports.py
│   │   ├── requirements.txt
│   │   └── run_example.py
│   ├── anomaly_detection.py
│   ├── blog/
│   │   ├── app.py
│   │   ├── requirements.txt
│   │   ├── static/
│   │   │   ├── css/
│   │   │   │   └── hilite.css
│   │   │   └── robots.txt
│   │   └── templates/
│   │       ├── base.html
│   │       ├── create.html
│   │       ├── detail.html
│   │       ├── edit.html
│   │       ├── includes/
│   │       │   └── pagination.html
│   │       ├── index.html
│   │       ├── login.html
│   │       └── logout.html
│   ├── diary.py
│   ├── graph.py
│   ├── hexastore.py
│   ├── query_library.py
│   ├── reddit_ranking.py
│   ├── sqlite_fts_compression.py
│   └── twitter/
│       ├── app.py
│       ├── requirements.txt
│       ├── run_example.py
│       ├── static/
│       │   └── style.css
│       └── templates/
│           ├── create.html
│           ├── homepage.html
│           ├── includes/
│           │   ├── message.html
│           │   └── pagination.html
│           ├── join.html
│           ├── layout.html
│           ├── login.html
│           ├── private_messages.html
│           ├── public_messages.html
│           ├── user_detail.html
│           ├── user_followers.html
│           ├── user_following.html
│           └── user_list.html
├── peewee.py
├── playhouse/
│   ├── README.md
│   ├── __init__.py
│   ├── _sqlite_udf.pyx
│   ├── apsw_ext.py
│   ├── cockroachdb.py
│   ├── cysqlite_ext.py
│   ├── dataset.py
│   ├── db_url.py
│   ├── fields.py
│   ├── flask_utils.py
│   ├── hybrid.py
│   ├── kv.py
│   ├── migrate.py
│   ├── mysql_ext.py
│   ├── pool.py
│   ├── postgres_ext.py
│   ├── pwasyncio.py
│   ├── pydantic_utils.py
│   ├── reflection.py
│   ├── shortcuts.py
│   ├── signals.py
│   ├── sqlcipher_ext.py
│   ├── sqlite_changelog.py
│   ├── sqlite_ext.py
│   ├── sqlite_udf.py
│   ├── sqliteq.py
│   └── test_utils.py
├── pwiz.py
├── pyproject.toml
├── runtests.py
├── setup.py
└── tests/
    ├── __init__.py
    ├── __main__.py
    ├── apsw_ext.py
    ├── base.py
    ├── base_models.py
    ├── cockroachdb.py
    ├── cysqlite_ext.py
    ├── dataset.py
    ├── db_tests.py
    ├── db_url.py
    ├── expressions.py
    ├── extra_fields.py
    ├── fields.py
    ├── hybrid.py
    ├── keys.py
    ├── kv.py
    ├── manytomany.py
    ├── migrations.py
    ├── model_save.py
    ├── model_sql.py
    ├── models.py
    ├── mysql_ext.py
    ├── pool.py
    ├── postgres.py
    ├── postgres_helpers.py
    ├── prefetch_tests.py
    ├── pwasyncio.py
    ├── pwasyncio_stress.py
    ├── pwiz_integration.py
    ├── pydantic_utils.py
    ├── queries.py
    ├── reflection.py
    ├── regressions.py
    ├── results.py
    ├── returning.py
    ├── schema.py
    ├── shortcuts.py
    ├── signals.py
    ├── sql.py
    ├── sqlcipher_ext.py
    ├── sqlite.py
    ├── sqlite_changelog.py
    ├── sqlite_helpers.py
    ├── sqlite_udf.py
    ├── sqliteq.py
    ├── test_utils.py
    └── transactions.py
Download .txt
Showing preview only (329K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4557 symbols across 86 files)

FILE: bench.py
  class Base (line 12) | class Base(Model):
    class Meta (line 13) | class Meta:
  class Register (line 16) | class Register(Base):
  class Collection (line 19) | class Collection(Base):
  class Item (line 22) | class Item(Base):
  function timed (line 29) | def timed(fn):
  function populate_register (line 41) | def populate_register(s, n):
  function populate_collections (line 45) | def populate_collections(n, n_i):
  function insert (line 52) | def insert(i):
  function batch_insert (line 57) | def batch_insert(i):
  function bulk_insert (line 63) | def bulk_insert(i):
  function bulk_create (line 70) | def bulk_create(i):
  function select (line 76) | def select(i):
  function select_related_dbapi_raw (line 82) | def select_related_dbapi_raw(i):
  function insert_related (line 89) | def insert_related(i):
  function select_related (line 94) | def select_related(i):
  function select_related_left (line 100) | def select_related_left(i):
  function select_related_dicts (line 106) | def select_related_dicts(i):
  function select_related_objects (line 112) | def select_related_objects(i):
  function select_prefetch (line 118) | def select_prefetch(i):
  function select_prefetch_join (line 125) | def select_prefetch_join(i):

FILE: docs/clubdata.sql
  type bookings (line 24) | CREATE TABLE bookings (
  type facilities (line 38) | CREATE TABLE facilities (
  type members (line 53) | CREATE TABLE members (
  type bookings (line 4236) | CREATE INDEX "bookings.memid_facid"
  type bookings (line 4241) | CREATE INDEX "bookings.facid_memid"
  type bookings (line 4246) | CREATE INDEX "bookings.facid_starttime"
  type bookings (line 4251) | CREATE INDEX "bookings.memid_starttime"
  type bookings (line 4256) | CREATE INDEX "bookings.starttime"
  type members (line 4261) | CREATE INDEX "members.joindate"
  type members (line 4266) | CREATE INDEX "members.recommendedby"

FILE: examples/adjacency_list.py
  class Node (line 6) | class Node(Model):
    class Meta (line 10) | class Meta:
    method __str__ (line 13) | def __str__(self):
    method dump (line 16) | def dump(self, _indent=0):

FILE: examples/analytics/app.py
  class BaseModel (line 54) | class BaseModel(Model):
    class Meta (line 55) | class Meta:
  class Account (line 59) | class Account(BaseModel):
    method verify_url (line 62) | def verify_url(self, url):
  class PageView (line 68) | class PageView(BaseModel):
    method create_from_request (line 79) | def create_from_request(cls, account, request):
  function analyze (line 94) | def analyze():
  function script (line 119) | def script():
  function not_found (line 129) | def not_found(e):
  function before_request (line 137) | def before_request():
  function after_request (line 143) | def after_request(response):

FILE: examples/analytics/reports.py
  class Report (line 8) | class Report(object):
    method __init__ (line 9) | def __init__(self, account_id=DEFAULT_ACCOUNT_ID):
    method get_query (line 13) | def get_query(self):
    method top_pages_by_time_period (line 19) | def top_pages_by_time_period(self, interval='day'):
    method cookies (line 40) | def cookies(self):
    method user_agents (line 49) | def user_agents(self):
    method languages (line 61) | def languages(self):
    method trail (line 79) | def trail(self):
    method _referrer_clause (line 93) | def _referrer_clause(self, domain_only=True):
    method top_referrers (line 99) | def top_referrers(self, domain_only=True):
    method referrers_for_url (line 110) | def referrers_for_url(self, domain_only=True):
    method referrers_to_url (line 118) | def referrers_to_url(self, domain_only=True):

FILE: examples/anomaly_detection.py
  class Reg (line 7) | class Reg(Model):
    class Meta (line 11) | class Meta:
  class StdDev (line 20) | class StdDev(object):
    method __init__ (line 21) | def __init__(self):
    method step (line 25) | def step(self, value):
    method finalize (line 29) | def finalize(self):

FILE: examples/blog/app.py
  class Entry (line 59) | class Entry(flask_db.Model):
    method html_content (line 67) | def html_content(self):
    method save (line 83) | def save(self, *args, **kwargs):
    method update_search_index (line 93) | def update_search_index(self):
    method public (line 113) | def public(cls):
    method drafts (line 117) | def drafts(cls):
    method search (line 121) | def search(cls, query):
  class FTSEntry (line 140) | class FTSEntry(FTSModel):
    class Meta (line 143) | class Meta:
  function login_required (line 146) | def login_required(fn):
  function login (line 155) | def login():
  function logout (line 171) | def logout():
  function index (line 178) | def index():
  function _create_or_edit (line 195) | def _create_or_edit(entry, template):
  function create (line 221) | def create():
  function drafts (line 226) | def drafts():
  function detail (line 231) | def detail(slug):
  function edit (line 241) | def edit(slug):
  function clean_querystring (line 246) | def clean_querystring(request_args, *keys_to_remove, **new_values):
  function not_found (line 259) | def not_found(exc):
  function main (line 262) | def main():

FILE: examples/diary.py
  class Entry (line 16) | class Entry(Model):
    class Meta (line 20) | class Meta:
  function initialize (line 24) | def initialize(passphrase):
  function menu_loop (line 29) | def menu_loop():
  function add_entry (line 39) | def add_entry():
  function view_entries (line 48) | def view_entries(search_query=None):
  function search_entries (line 70) | def search_entries():

FILE: examples/graph.py
  class Base (line 7) | class Base(Model):
    class Meta (line 8) | class Meta:
  class Node (line 12) | class Node(Base):
    method outgoing (line 15) | def outgoing(self):
    method incoming (line 22) | def incoming(self):
  class Edge (line 30) | class Edge(Base):
  function bellman_ford (line 54) | def bellman_ford(s):
  function print_path (line 78) | def print_path(s, e):

FILE: examples/hexastore.py
  class Hexastore (line 10) | class Hexastore(object):
    method __init__ (line 11) | def __init__(self, database=':memory:', **options):
    method get_model (line 23) | def get_model(self):
    method store (line 39) | def store(self, s, p, o):
    method store_many (line 42) | def store_many(self, items):
    method delete (line 46) | def delete(self, s, p, o):
    method query (line 51) | def query(self, s=None, p=None, o=None):
    method search (line 57) | def search(self, *conditions):
  class _VariableFactory (line 94) | class _VariableFactory(object):
    method __getattr__ (line 95) | def __getattr__(self, name):
  class Variable (line 99) | class Variable(object):
    method __init__ (line 102) | def __init__(self, name):
    method __hash__ (line 105) | def __hash__(self):
    method __repr__ (line 108) | def __repr__(self):

FILE: examples/query_library.py
  class BaseModel (line 10) | class BaseModel(Model):
    class Meta (line 11) | class Meta:
  class Member (line 14) | class Member(BaseModel):
    class Meta (line 25) | class Meta:
  class Facility (line 33) | class Facility(BaseModel):
    class Meta (line 41) | class Meta:
  class Booking (line 45) | class Booking(BaseModel):
    class Meta (line 52) | class Meta:

FILE: examples/reddit_ranking.py
  function log (line 11) | def log(n, b):
  class Base (line 14) | class Base(Model):
    class Meta (line 15) | class Meta:
  class Post (line 18) | class Post(Base):

FILE: examples/sqlite_fts_compression.py
  class SearchIndex (line 13) | class SearchIndex(FTSModel):
    class Meta (line 16) | class Meta:
  function _zlib_compress (line 21) | def _zlib_compress(data):
  function _zlib_decompress (line 28) | def _zlib_decompress(data):

FILE: examples/twitter/app.py
  class BaseModel (line 31) | class BaseModel(Model):
    class Meta (line 32) | class Meta:
  class User (line 36) | class User(BaseModel):
    method following (line 44) | def following(self):
    method followers (line 52) | def followers(self):
    method is_following (line 59) | def is_following(self, user):
    method gravatar_url (line 67) | def gravatar_url(self, size=80):
  class Relationship (line 76) | class Relationship(BaseModel):
    class Meta (line 80) | class Meta:
  class Message (line 90) | class Message(BaseModel):
  function create_tables (line 97) | def create_tables():
  function auth_user (line 104) | def auth_user(user):
  function get_current_user (line 111) | def get_current_user():
  function login_required (line 118) | def login_required(f):
  function object_list (line 128) | def object_list(template_name, qr, var_name='object_list', **kwargs):
  function get_object_or_404 (line 139) | def get_object_or_404(model, *expressions):
  function is_following (line 149) | def is_following(from_user, to_user):
  function before_request (line 155) | def before_request():
  function teardown_request (line 159) | def teardown_request(exc=None):
  function homepage (line 165) | def homepage():
  function private_timeline (line 174) | def private_timeline():
  function public_timeline (line 186) | def public_timeline():
  function join (line 192) | def join():
  function login (line 214) | def login():
  function logout (line 230) | def logout():
  function following (line 237) | def following():
  function followers (line 243) | def followers():
  function user_list (line 248) | def user_list():
  function user_detail (line 253) | def user_detail(username):
  function user_follow (line 266) | def user_follow(username):
  function user_unfollow (line 281) | def user_unfollow(username):
  function create (line 294) | def create():
  function _inject_user (line 307) | def _inject_user():

FILE: peewee.py
  function reraise (line 161) | def reraise(tp, value, tb=None):
  function utcfromtimestamp (line 171) | def utcfromtimestamp(ts):
  function utcnow (line 175) | def utcnow():
  function datetime_adapter (line 187) | def datetime_adapter(d): return d.isoformat(' ')
  function convert_date (line 188) | def convert_date(d): return datetime.date(*map(int, d.split(b'-')))
  function convert_timestamp (line 189) | def convert_timestamp(t):
  function _sqlite_date_part (line 232) | def _sqlite_date_part(lookup_type, datetime_string):
  function _sqlite_date_trunc (line 239) | def _sqlite_date_trunc(lookup_type, datetime_string):
  function _sqlite_regexp (line 246) | def _sqlite_regexp(regex, value):
  function __deprecated__ (line 252) | def __deprecated__(s):
  class attrdict (line 256) | class attrdict(dict):
    method __getattr__ (line 257) | def __getattr__(self, attr):
    method __setattr__ (line 262) | def __setattr__(self, attr, value): self[attr] = value
    method __iadd__ (line 263) | def __iadd__(self, rhs): self.update(rhs); return self
    method __add__ (line 264) | def __add__(self, rhs): d = attrdict(self); d.update(rhs); return d
  function with_metaclass (line 388) | def with_metaclass(meta, base=object):
  function merge_dict (line 391) | def merge_dict(source, overrides):
  function quote (line 397) | def quote(path, quote_chars):
  function ensure_tuple (line 404) | def ensure_tuple(value):
  function ensure_entity (line 408) | def ensure_entity(value):
  function make_snake_case (line 412) | def make_snake_case(s):
  function make_identifier (line 416) | def make_identifier(s):
  function chunked (line 422) | def chunked(it, n):
  class _callable_context_manager (line 431) | class _callable_context_manager(object):
    method __call__ (line 432) | def __call__(self, fn):
  class Proxy (line 440) | class Proxy(object):
    method __init__ (line 446) | def __init__(self):
    method initialize (line 450) | def initialize(self, obj):
    method attach_callback (line 455) | def attach_callback(self, callback):
    method passthrough (line 459) | def passthrough(method):
    method __getattr__ (line 470) | def __getattr__(self, attr):
    method __setattr__ (line 475) | def __setattr__(self, attr, value):
  class DatabaseProxy (line 481) | class DatabaseProxy(Proxy):
    method connection_context (line 487) | def connection_context(self):
    method atomic (line 489) | def atomic(self, *args, **kwargs):
    method manual_commit (line 491) | def manual_commit(self):
    method transaction (line 493) | def transaction(self, *args, **kwargs):
    method savepoint (line 495) | def savepoint(self):
    method Model (line 498) | def Model(self):
  class ModelDescriptor (line 505) | class ModelDescriptor(object): pass
  class AliasManager (line 511) | class AliasManager(object):
    method __init__ (line 514) | def __init__(self):
    method mapping (line 522) | def mapping(self):
    method add (line 525) | def add(self, source):
    method get (line 531) | def get(self, source, any_depth=False):
    method __getitem__ (line 538) | def __getitem__(self, source):
    method __setitem__ (line 541) | def __setitem__(self, source, alias):
    method push (line 544) | def push(self):
    method pop (line 549) | def pop(self):
  class State (line 556) | class State(collections.namedtuple('_State', ('scope', 'parentheses',
    method __new__ (line 558) | def __new__(cls, scope=SCOPE_NORMAL, parentheses=False, **kwargs):
    method __call__ (line 561) | def __call__(self, scope=None, parentheses=None, **kwargs):
    method __getattr__ (line 575) | def __getattr__(self, attr_name):
  function __scope_context__ (line 579) | def __scope_context__(scope):
  class Context (line 587) | class Context(object):
    method __init__ (line 590) | def __init__(self, **settings):
    method as_new (line 597) | def as_new(self):
    method column_sort_key (line 600) | def column_sort_key(self, item):
    method scope (line 604) | def scope(self):
    method parentheses (line 608) | def parentheses(self):
    method subquery (line 612) | def subquery(self):
    method __call__ (line 615) | def __call__(self, **overrides):
    method __enter__ (line 629) | def __enter__(self):
    method __exit__ (line 634) | def __exit__(self, exc_type, exc_val, exc_tb):
    method push_alias (line 640) | def push_alias(self):
    method sql (line 645) | def sql(self, obj):
    method literal (line 653) | def literal(self, keyword):
    method value (line 657) | def value(self, value, converter=None, add_param=True):
    method __sql__ (line 682) | def __sql__(self, ctx):
    method parse (line 687) | def parse(self, node):
    method query (line 690) | def query(self):
  function query_to_string (line 694) | def query_to_string(query):
  function _query_val_transform (line 714) | def _query_val_transform(v):
  class Node (line 737) | class Node(object):
    method clone (line 741) | def clone(self):
    method __sql__ (line 746) | def __sql__(self, ctx):
    method copy (line 750) | def copy(method):
    method coerce (line 757) | def coerce(self, _coerce=True):
    method is_alias (line 764) | def is_alias(self):
    method unwrap (line 767) | def unwrap(self):
  class ColumnFactory (line 771) | class ColumnFactory(object):
    method __init__ (line 774) | def __init__(self, node):
    method __getattr__ (line 777) | def __getattr__(self, attr):
  class _DynamicColumn (line 782) | class _DynamicColumn(object):
    method __get__ (line 785) | def __get__(self, instance, instance_type=None):
  class _ExplicitColumn (line 791) | class _ExplicitColumn(object):
    method __get__ (line 794) | def __get__(self, instance, instance_type=None):
  class Star (line 802) | class Star(Node):
    method __init__ (line 803) | def __init__(self, source):
    method __sql__ (line 805) | def __sql__(self, ctx):
  class Source (line 809) | class Source(Node):
    method __init__ (line 812) | def __init__(self, alias=None):
    method alias (line 817) | def alias(self, name):
    method select (line 820) | def select(self, *columns):
    method __star__ (line 826) | def __star__(self):
    method join (line 829) | def join(self, dest, join_type=JOIN.INNER, on=None):
    method left_outer_join (line 832) | def left_outer_join(self, dest, on=None):
    method cte (line 835) | def cte(self, name, recursive=False, columns=None, materialized=None):
    method get_sort_key (line 839) | def get_sort_key(self, ctx):
    method apply_alias (line 844) | def apply_alias(self, ctx):
    method apply_column (line 853) | def apply_column(self, ctx):
  class _HashableSource (line 859) | class _HashableSource(object):
    method __init__ (line 860) | def __init__(self, *args, **kwargs):
    method alias (line 865) | def alias(self, name):
    method _update_hash (line 869) | def _update_hash(self):
    method _get_hash (line 872) | def _get_hash(self):
    method __hash__ (line 875) | def __hash__(self):
    method __eq__ (line 878) | def __eq__(self, other):
    method __ne__ (line 883) | def __ne__(self, other):
    method _e (line 888) | def _e(op):
  function __bind_database__ (line 898) | def __bind_database__(meth):
  function __join__ (line 908) | def __join__(join_type=JOIN.INNER, inverted=False):
  class BaseTable (line 916) | class BaseTable(Source):
  class _BoundTableContext (line 929) | class _BoundTableContext(object):
    method __init__ (line 930) | def __init__(self, table, database):
    method __call__ (line 934) | def __call__(self, fn):
    method __enter__ (line 941) | def __enter__(self):
    method __exit__ (line 948) | def __exit__(self, exc_type, exc_val, exc_tb):
  class Table (line 954) | class Table(_HashableSource, BaseTable):
    method __init__ (line 955) | def __init__(self, name, columns=None, primary_key=None, schema=None,
    method clone (line 978) | def clone(self):
    method bind (line 989) | def bind(self, database=None):
    method bind_ctx (line 993) | def bind_ctx(self, database=None):
    method _get_hash (line 996) | def _get_hash(self):
    method select (line 1000) | def select(self, *columns):
    method insert (line 1006) | def insert(self, insert=None, columns=None, **kwargs):
    method replace (line 1015) | def replace(self, insert=None, columns=None, **kwargs):
    method update (line 1021) | def update(self, update=None, **kwargs):
    method delete (line 1030) | def delete(self):
    method __sql__ (line 1033) | def __sql__(self, ctx):
  class Join (line 1049) | class Join(BaseTable):
    method __init__ (line 1050) | def __init__(self, lhs, rhs, join_type=JOIN.INNER, on=None, alias=None):
    method on (line 1057) | def on(self, predicate):
    method __sql__ (line 1061) | def __sql__(self, ctx):
  class ValuesList (line 1071) | class ValuesList(_HashableSource, BaseTable):
    method __init__ (line 1072) | def __init__(self, values, columns=None, alias=None):
    method _get_hash (line 1077) | def _get_hash(self):
    method columns (line 1081) | def columns(self, *names):
    method __sql__ (line 1084) | def __sql__(self, ctx):
  class CTE (line 1106) | class CTE(_HashableSource, Source):
    method __init__ (line 1107) | def __init__(self, name, query, recursive=False, columns=None,
    method select_from (line 1120) | def select_from(self, *columns):
    method _get_hash (line 1134) | def _get_hash(self):
    method union_all (line 1137) | def union_all(self, rhs):
    method union (line 1142) | def union(self, rhs):
    method __sql__ (line 1147) | def __sql__(self, ctx):
  class ColumnBase (line 1169) | class ColumnBase(Node):
    method converter (line 1173) | def converter(self, converter=None):
    method alias (line 1176) | def alias(self, alias):
    method unalias (line 1181) | def unalias(self):
    method bind_to (line 1184) | def bind_to(self, dest):
    method cast (line 1187) | def cast(self, as_type):
    method asc (line 1190) | def asc(self, collation=None, nulls=None):
    method desc (line 1194) | def desc(self, collation=None, nulls=None):
    method __invert__ (line 1198) | def __invert__(self):
    method _e (line 1201) | def _e(op, inv=False):
    method __eq__ (line 1227) | def __eq__(self, rhs):
    method __ne__ (line 1230) | def __ne__(self, rhs):
    method is_null (line 1254) | def is_null(self, is_null=True):
    method _escape_like_expr (line 1258) | def _escape_like_expr(self, s, template):
    method contains (line 1269) | def contains(self, rhs):
    method startswith (line 1276) | def startswith(self, rhs):
    method endswith (line 1282) | def endswith(self, rhs):
    method between (line 1288) | def between(self, lo, hi):
    method concat (line 1290) | def concat(self, rhs):
    method __getitem__ (line 1292) | def __getitem__(self, item):
    method distinct (line 1301) | def distinct(self):
    method collate (line 1304) | def collate(self, collation):
    method get_sort_key (line 1307) | def get_sort_key(self, ctx):
  class Column (line 1311) | class Column(ColumnBase):
    method __init__ (line 1312) | def __init__(self, source, name):
    method get_sort_key (line 1316) | def get_sort_key(self, ctx):
    method __hash__ (line 1322) | def __hash__(self):
    method __sql__ (line 1325) | def __sql__(self, ctx):
  class WrappedNode (line 1333) | class WrappedNode(ColumnBase):
    method __init__ (line 1334) | def __init__(self, node):
    method is_alias (line 1339) | def is_alias(self):
    method unwrap (line 1342) | def unwrap(self):
  class EntityFactory (line 1346) | class EntityFactory(object):
    method __init__ (line 1348) | def __init__(self, node):
    method __getattr__ (line 1350) | def __getattr__(self, attr):
  class _DynamicEntity (line 1354) | class _DynamicEntity(object):
    method __get__ (line 1356) | def __get__(self, instance, instance_type=None):
  class Alias (line 1362) | class Alias(WrappedNode):
    method __init__ (line 1365) | def __init__(self, node, alias):
    method __hash__ (line 1369) | def __hash__(self):
    method name (line 1373) | def name(self):
    method name (line 1376) | def name(self, value):
    method alias (line 1379) | def alias(self, alias=None):
    method unalias (line 1385) | def unalias(self):
    method is_alias (line 1388) | def is_alias(self):
    method __sql__ (line 1391) | def __sql__(self, ctx):
  class BindTo (line 1401) | class BindTo(WrappedNode):
    method __init__ (line 1402) | def __init__(self, node, dest):
    method __sql__ (line 1406) | def __sql__(self, ctx):
  class Negated (line 1410) | class Negated(WrappedNode):
    method __invert__ (line 1411) | def __invert__(self):
    method __sql__ (line 1414) | def __sql__(self, ctx):
  class BitwiseMixin (line 1418) | class BitwiseMixin(object):
    method __and__ (line 1419) | def __and__(self, other):
    method __or__ (line 1422) | def __or__(self, other):
    method __sub__ (line 1425) | def __sub__(self, other):
    method __invert__ (line 1428) | def __invert__(self):
  class BitwiseNegated (line 1432) | class BitwiseNegated(BitwiseMixin, WrappedNode):
    method __invert__ (line 1435) | def __invert__(self):
    method __sql__ (line 1438) | def __sql__(self, ctx):
  class Value (line 1446) | class Value(ColumnBase):
    method __init__ (line 1447) | def __init__(self, value, converter=None, unpack=True):
    method __sql__ (line 1461) | def __sql__(self, ctx):
  class ValueLiterals (line 1469) | class ValueLiterals(WrappedNode):
    method __sql__ (line 1470) | def __sql__(self, ctx):
  function AsIs (line 1475) | def AsIs(value, converter=None):
  class Cast (line 1479) | class Cast(WrappedNode):
    method __init__ (line 1480) | def __init__(self, node, cast):
    method __sql__ (line 1485) | def __sql__(self, ctx):
  class Ordering (line 1492) | class Ordering(WrappedNode):
    method __init__ (line 1493) | def __init__(self, node, direction, collation=None, nulls=None):
    method collate (line 1502) | def collate(self, collation=None):
    method _null_ordering_case (line 1505) | def _null_ordering_case(self, nulls):
    method __sql__ (line 1514) | def __sql__(self, ctx):
  function Asc (line 1526) | def Asc(node, collation=None, nulls=None):
  function Desc (line 1530) | def Desc(node, collation=None, nulls=None):
  class Expression (line 1534) | class Expression(ColumnBase):
    method __init__ (line 1535) | def __init__(self, lhs, op, rhs, flat=False):
    method __sql__ (line 1541) | def __sql__(self, ctx):
    method _is_rhs_empty (line 1579) | def _is_rhs_empty(self, rhs, ctx):
  class StringExpression (line 1588) | class StringExpression(Expression):
    method __add__ (line 1589) | def __add__(self, rhs):
    method __radd__ (line 1591) | def __radd__(self, lhs):
  class Entity (line 1595) | class Entity(ColumnBase):
    method __init__ (line 1596) | def __init__(self, *path):
    method __getattr__ (line 1599) | def __getattr__(self, attr):
    method get_sort_key (line 1602) | def get_sort_key(self, ctx):
    method __hash__ (line 1605) | def __hash__(self):
    method __sql__ (line 1608) | def __sql__(self, ctx):
  class SQL (line 1615) | class SQL(ColumnBase):
    method __init__ (line 1616) | def __init__(self, sql, params=None):
    method __sql__ (line 1620) | def __sql__(self, ctx):
  function Check (line 1628) | def Check(constraint, name=None):
  function Default (line 1635) | def Default(value):
  class Function (line 1639) | class Function(ColumnBase):
    method __init__ (line 1642) | def __init__(self, name, arguments, coerce=True, python_value=None):
    method __getattr__ (line 1653) | def __getattr__(self, attr):
    method filter (line 1659) | def filter(self, where=None):
    method order_by (line 1663) | def order_by(self, *ordering):
    method python_value (line 1667) | def python_value(self, func=None):
    method over (line 1670) | def over(self, partition_by=None, order_by=None, start=None, end=None,
    method __sql__ (line 1683) | def __sql__(self, ctx):
  class Window (line 1712) | class Window(Node):
    method __init__ (line 1724) | def __init__(self, partition_by=None, order_by=None, start=None, end=N...
    method alias (line 1745) | def alias(self, alias=None):
    method as_range (line 1750) | def as_range(self):
    method as_rows (line 1754) | def as_rows(self):
    method as_groups (line 1758) | def as_groups(self):
    method extends (line 1762) | def extends(self, window=None):
    method exclude (line 1766) | def exclude(self, frame_exclusion=None):
    method following (line 1772) | def following(value=None):
    method preceding (line 1778) | def preceding(value=None):
    method __sql__ (line 1783) | def __sql__(self, ctx):
  class WindowAlias (line 1822) | class WindowAlias(Node):
    method __init__ (line 1823) | def __init__(self, window):
    method alias (line 1826) | def alias(self, window_alias):
    method __sql__ (line 1830) | def __sql__(self, ctx):
  class _InFunction (line 1834) | class _InFunction(Node):
    method __init__ (line 1835) | def __init__(self, node, in_function=True):
    method __sql__ (line 1839) | def __sql__(self, ctx):
  class Case (line 1844) | class Case(ColumnBase):
    method __init__ (line 1845) | def __init__(self, predicate, expression_tuples, default=None):
    method __sql__ (line 1850) | def __sql__(self, ctx):
  class ForUpdate (line 1864) | class ForUpdate(Node):
    method __init__ (line 1865) | def __init__(self, expr, of=None, nowait=None, skip_locked=None):
    method __sql__ (line 1885) | def __sql__(self, ctx):
  class NodeList (line 1896) | class NodeList(ColumnBase):
    method __init__ (line 1897) | def __init__(self, nodes, glue=' ', parens=False):
    method __sql__ (line 1902) | def __sql__(self, ctx):
  function CommaNodeList (line 1923) | def CommaNodeList(nodes):
  function EnclosedNodeList (line 1927) | def EnclosedNodeList(nodes):
  class _Namespace (line 1931) | class _Namespace(Node):
    method __init__ (line 1933) | def __init__(self, name):
    method __getattr__ (line 1935) | def __getattr__(self, attr):
  class NamespaceAttribute (line 1939) | class NamespaceAttribute(ColumnBase):
    method __init__ (line 1940) | def __init__(self, namespace, attribute):
    method __sql__ (line 1944) | def __sql__(self, ctx):
  class DQ (line 1952) | class DQ(ColumnBase):
    method __init__ (line 1953) | def __init__(self, **query):
    method __invert__ (line 1959) | def __invert__(self):
    method clone (line 1962) | def clone(self):
  class QualifiedNames (line 1971) | class QualifiedNames(WrappedNode):
    method __sql__ (line 1972) | def __sql__(self, ctx):
  function qualify_names (line 1977) | def qualify_names(node):
  class OnConflict (line 1988) | class OnConflict(Node):
    method __init__ (line 1989) | def __init__(self, action=None, update=None, preserve=None, where=None,
    method get_conflict_statement (line 2003) | def get_conflict_statement(self, ctx, query):
    method get_conflict_update (line 2006) | def get_conflict_update(self, ctx, query):
    method preserve (line 2010) | def preserve(self, *columns):
    method update (line 2014) | def update(self, _data=None, **kwargs):
    method where (line 2024) | def where(self, *expressions):
    method conflict_target (line 2030) | def conflict_target(self, *constraints):
    method conflict_where (line 2035) | def conflict_where(self, *expressions):
    method conflict_constraint (line 2041) | def conflict_constraint(self, constraint):
  function database_required (line 2046) | def database_required(method):
  class BaseQuery (line 2058) | class BaseQuery(Node):
    method __init__ (line 2061) | def __init__(self, _database=None, **kwargs):
    method bind (line 2068) | def bind(self, database=None):
    method clone (line 2072) | def clone(self):
    method dicts (line 2078) | def dicts(self, as_dict=True):
    method tuples (line 2083) | def tuples(self, as_tuple=True):
    method namedtuples (line 2088) | def namedtuples(self, as_namedtuple=True):
    method objects (line 2093) | def objects(self, constructor=None):
    method _get_cursor_wrapper (line 2098) | def _get_cursor_wrapper(self, cursor):
    method __sql__ (line 2112) | def __sql__(self, ctx):
    method sql (line 2115) | def sql(self):
    method execute (line 2123) | def execute(self, database):
    method _execute (line 2126) | def _execute(self, database):
    method iterator (line 2129) | def iterator(self, database=None):
    method _ensure_execution (line 2132) | def _ensure_execution(self):
    method __iter__ (line 2138) | def __iter__(self):
    method __getitem__ (line 2142) | def __getitem__(self, value):
    method __len__ (line 2153) | def __len__(self):
    method __str__ (line 2157) | def __str__(self):
  class RawQuery (line 2161) | class RawQuery(BaseQuery):
    method __init__ (line 2162) | def __init__(self, sql=None, params=None, **kwargs):
    method __sql__ (line 2167) | def __sql__(self, ctx):
    method _execute (line 2174) | def _execute(self, database):
  class Query (line 2181) | class Query(BaseQuery):
    method __init__ (line 2182) | def __init__(self, where=None, order_by=None, limit=None, offset=None,
    method with_cte (line 2193) | def with_cte(self, *cte_list):
    method where (line 2197) | def where(self, *expressions):
    method orwhere (line 2203) | def orwhere(self, *expressions):
    method order_by (line 2209) | def order_by(self, *values):
    method order_by_extend (line 2213) | def order_by_extend(self, *values):
    method limit (line 2217) | def limit(self, value=None):
    method offset (line 2221) | def offset(self, value=None):
    method paginate (line 2225) | def paginate(self, page, paginate_by=20):
    method _apply_ordering (line 2230) | def _apply_ordering(self, ctx):
    method __sql__ (line 2243) | def __sql__(self, ctx):
  function __compound_select__ (line 2259) | def __compound_select__(operation, inverted=False):
  class SelectQuery (line 2268) | class SelectQuery(Query):
    method select_from (line 2278) | def select_from(self, *columns):
  class SelectBase (line 2290) | class SelectBase(_HashableSource, Source, SelectQuery):
    method _get_hash (line 2291) | def _get_hash(self):
    method _execute (line 2294) | def _execute(self, database):
    method peek (line 2301) | def peek(self, database, n=1):
    method first (line 2307) | def first(self, database, n=1):
    method scalar (line 2314) | def scalar(self, database, as_tuple=False, as_dict=False):
    method scalars (line 2321) | def scalars(self, database):
    method count (line 2326) | def count(self, database, clear_limit=False):
    method exists (line 2340) | def exists(self, database):
    method get (line 2347) | def get(self, database):
  class CompoundSelectQuery (line 2358) | class CompoundSelectQuery(SelectBase):
    method __init__ (line 2359) | def __init__(self, lhs, op, rhs):
    method _returning (line 2366) | def _returning(self):
    method exists (line 2370) | def exists(self, database):
    method _get_query_key (line 2374) | def _get_query_key(self):
    method _wrap_parens (line 2377) | def _wrap_parens(self, ctx, subq):
    method __sql__ (line 2395) | def __sql__(self, ctx):
  class Select (line 2425) | class Select(SelectBase):
    method __init__ (line 2426) | def __init__(self, from_list=None, columns=None, group_by=None,
    method clone (line 2448) | def clone(self):
    method columns (line 2455) | def columns(self, *columns, **kwargs):
    method select_extend (line 2460) | def select_extend(self, *columns):
    method selected_columns (line 2464) | def selected_columns(self):
    method selected_columns (line 2467) | def selected_columns(self, value):
    method from_ (line 2471) | def from_(self, *sources):
    method join (line 2475) | def join(self, dest, join_type=JOIN.INNER, on=None):
    method left_outer_join (line 2483) | def left_outer_join(self, dest, on=None):
    method group_by (line 2487) | def group_by(self, *columns):
    method group_by_extend (line 2501) | def group_by_extend(self, *values):
    method having (line 2507) | def having(self, *expressions):
    method distinct (line 2513) | def distinct(self, *columns):
    method window (line 2521) | def window(self, *windows):
    method for_update (line 2525) | def for_update(self, for_update=True, of=None, nowait=None,
    method lateral (line 2536) | def lateral(self, lateral=True):
    method _get_query_key (line 2539) | def _get_query_key(self):
    method __sql_selection__ (line 2542) | def __sql_selection__(self, ctx, is_subquery=False):
    method __sql__ (line 2545) | def __sql__(self, ctx):
  class _WriteQuery (line 2617) | class _WriteQuery(Query):
    method __init__ (line 2618) | def __init__(self, table, returning=None, **kwargs):
    method cte (line 2624) | def cte(self, name, recursive=False, columns=None, materialized=None):
    method returning (line 2629) | def returning(self, *returning):
    method apply_returning (line 2633) | def apply_returning(self, ctx):
    method _execute (line 2639) | def _execute(self, database):
    method execute_returning (line 2646) | def execute_returning(self, database):
    method handle_result (line 2652) | def handle_result(self, database, cursor):
    method _set_table_alias (line 2657) | def _set_table_alias(self, ctx):
    method __sql__ (line 2660) | def __sql__(self, ctx):
  class Update (line 2669) | class Update(_WriteQuery):
    method __init__ (line 2670) | def __init__(self, table, update=None, **kwargs):
    method from_ (line 2676) | def from_(self, *sources):
    method __sql__ (line 2679) | def __sql__(self, ctx):
  class Insert (line 2719) | class Insert(_WriteQuery):
    class DefaultValuesException (line 2723) | class DefaultValuesException(Exception): pass
    method __init__ (line 2725) | def __init__(self, table, insert=None, columns=None, on_conflict=None,
    method where (line 2734) | def where(self, *expressions):
    method as_rowcount (line 2738) | def as_rowcount(self, _as_rowcount=True):
    method on_conflict_ignore (line 2742) | def on_conflict_ignore(self, ignore=True):
    method on_conflict_replace (line 2746) | def on_conflict_replace(self, replace=True):
    method on_conflict (line 2750) | def on_conflict(self, *args, **kwargs):
    method _simple_insert (line 2754) | def _simple_insert(self, ctx):
    method get_default_data (line 2759) | def get_default_data(self):
    method get_default_columns (line 2762) | def get_default_columns(self):
    method _generate_insert (line 2767) | def _generate_insert(self, insert, ctx):
    method _query_insert (line 2881) | def _query_insert(self, ctx):
    method _default_values (line 2887) | def _default_values(self, ctx):
    method __sql__ (line 2892) | def __sql__(self, ctx):
    method _execute (line 2925) | def _execute(self, database):
    method handle_result (line 2934) | def handle_result(self, database, cursor):
  class Delete (line 2942) | class Delete(_WriteQuery):
    method __sql__ (line 2943) | def __sql__(self, ctx):
  class Index (line 2956) | class Index(Node):
    method __init__ (line 2957) | def __init__(self, name, table, expressions, unique=False, safe=False,
    method safe (line 2971) | def safe(self, _safe=True):
    method where (line 2975) | def where(self, *expressions):
    method using (line 2981) | def using(self, _using=None):
    method nulls_distinct (line 2985) | def nulls_distinct(self, nulls_distinct=None):
    method __sql__ (line 2990) | def __sql__(self, ctx):
  class ModelIndex (line 3034) | class ModelIndex(Index):
    method __init__ (line 3035) | def __init__(self, model, fields, unique=False, safe=True, where=None,
    method _generate_name_from_fields (line 3054) | def _generate_name_from_fields(self, model, fields):
  function _truncate_constraint_name (line 3075) | def _truncate_constraint_name(constraint, maxlen=64):
  class PeeweeException (line 3085) | class PeeweeException(Exception):
    method __init__ (line 3086) | def __init__(self, *args):
  class ImproperlyConfigured (line 3090) | class ImproperlyConfigured(PeeweeException): pass
  class DatabaseError (line 3091) | class DatabaseError(PeeweeException): pass
  class DataError (line 3092) | class DataError(DatabaseError): pass
  class IntegrityError (line 3093) | class IntegrityError(DatabaseError): pass
  class InterfaceError (line 3094) | class InterfaceError(PeeweeException): pass
  class InternalError (line 3095) | class InternalError(DatabaseError): pass
  class NotSupportedError (line 3096) | class NotSupportedError(DatabaseError): pass
  class OperationalError (line 3097) | class OperationalError(DatabaseError): pass
  class ProgrammingError (line 3098) | class ProgrammingError(DatabaseError): pass
  class ExceptionWrapper (line 3101) | class ExceptionWrapper(object):
    method __init__ (line 3103) | def __init__(self, exceptions):
    method __enter__ (line 3105) | def __enter__(self): pass
    method __exit__ (line 3106) | def __exit__(self, exc_type, exc_value, traceback):
  class _ConnectionState (line 3155) | class _ConnectionState(object):
    method __init__ (line 3156) | def __init__(self, **kwargs):
    method reset (line 3160) | def reset(self):
    method set_connection (line 3166) | def set_connection(self, conn):
  class _ConnectionLocal (line 3173) | class _ConnectionLocal(_ConnectionState, threading.local): pass
  class _NoopLock (line 3174) | class _NoopLock(object):
    method __enter__ (line 3176) | def __enter__(self): return self
    method __exit__ (line 3177) | def __exit__(self, exc_type, exc_val, exc_tb): pass
  class ConnectionContext (line 3180) | class ConnectionContext(object):
    method __init__ (line 3182) | def __init__(self, db): self.db = db
    method __enter__ (line 3183) | def __enter__(self):
    method __exit__ (line 3186) | def __exit__(self, exc_type, exc_val, exc_tb): self.db.close()
    method __call__ (line 3187) | def __call__(self, fn):
  class Database (line 3195) | class Database(_callable_context_manager):
    method __init__ (line 3216) | def __init__(self, database, thread_safe=True, autorollback=False,
    method init (line 3254) | def init(self, database, **kwargs):
    method __enter__ (line 3261) | def __enter__(self):
    method __exit__ (line 3269) | def __exit__(self, exc_type, exc_val, exc_tb):
    method connection_context (line 3277) | def connection_context(self):
    method _connect (line 3280) | def _connect(self):
    method connect (line 3283) | def connect(self, reuse_if_open=False):
    method _initialize_connection (line 3301) | def _initialize_connection(self, conn):
    method _set_server_version (line 3304) | def _set_server_version(self, conn):
    method close (line 3307) | def close(self):
    method _close (line 3324) | def _close(self, conn):
    method is_closed (line 3327) | def is_closed(self):
    method is_connection_usable (line 3330) | def is_connection_usable(self):
    method connection (line 3333) | def connection(self):
    method cursor (line 3338) | def cursor(self, named_cursor=None):
    method execute_sql (line 3346) | def execute_sql(self, sql, params=None):
    method execute (line 3354) | def execute(self, query, **context_options):
    method get_context_options (line 3359) | def get_context_options(self):
    method get_sql_context (line 3375) | def get_sql_context(self, **context_options):
    method conflict_statement (line 3381) | def conflict_statement(self, on_conflict, query):
    method conflict_update (line 3384) | def conflict_update(self, on_conflict, query):
    method _build_on_conflict_update (line 3387) | def _build_on_conflict_update(self, on_conflict, query):
    method last_insert_id (line 3432) | def last_insert_id(self, cursor, query_type=None):
    method rows_affected (line 3435) | def rows_affected(self, cursor):
    method default_values_insert (line 3438) | def default_values_insert(self, ctx):
    method session_start (line 3441) | def session_start(self):
    method session_commit (line 3444) | def session_commit(self):
    method session_rollback (line 3452) | def session_rollback(self):
    method in_transaction (line 3460) | def in_transaction(self):
    method push_transaction (line 3463) | def push_transaction(self, transaction):
    method pop_transaction (line 3466) | def pop_transaction(self):
    method transaction_depth (line 3469) | def transaction_depth(self):
    method top_transaction (line 3472) | def top_transaction(self):
    method atomic (line 3476) | def atomic(self, *args, **kwargs):
    method manual_commit (line 3479) | def manual_commit(self):
    method transaction (line 3482) | def transaction(self, *args, **kwargs):
    method savepoint (line 3485) | def savepoint(self):
    method begin (line 3488) | def begin(self):
    method rollback (line 3494) | def rollback(self):
    method commit (line 3498) | def commit(self):
    method batch_commit (line 3502) | def batch_commit(self, it, n):
    method table_exists (line 3508) | def table_exists(self, table_name, schema=None):
    method get_tables (line 3515) | def get_tables(self, schema=None):
    method get_indexes (line 3518) | def get_indexes(self, table, schema=None):
    method get_columns (line 3521) | def get_columns(self, table, schema=None):
    method get_primary_keys (line 3524) | def get_primary_keys(self, table, schema=None):
    method get_foreign_keys (line 3527) | def get_foreign_keys(self, table, schema=None):
    method sequence_exists (line 3530) | def sequence_exists(self, seq):
    method create_tables (line 3533) | def create_tables(self, models, **options):
    method drop_tables (line 3537) | def drop_tables(self, models, **kwargs):
    method extract_date (line 3541) | def extract_date(self, date_part, date_field):
    method truncate_date (line 3544) | def truncate_date(self, date_part, date_field):
    method to_timestamp (line 3547) | def to_timestamp(self, date_field):
    method from_timestamp (line 3550) | def from_timestamp(self, date_field):
    method random (line 3553) | def random(self):
    method bind (line 3556) | def bind(self, models, bind_refs=True, bind_backrefs=True):
    method bind_ctx (line 3560) | def bind_ctx(self, models, bind_refs=True, bind_backrefs=True):
    method get_noop_select (line 3563) | def get_noop_select(self, ctx):
    method Model (line 3567) | def Model(self):
  function __pragma__ (line 3574) | def __pragma__(name):
  class SqliteDatabase (line 3582) | class SqliteDatabase(Database):
    method __init__ (line 3598) | def __init__(self, database, pragmas=None, regexp_function=False,
    method init (line 3622) | def init(self, database, pragmas=None, timeout=5, returning_clause=None,
    method _set_server_version (line 3635) | def _set_server_version(self, conn):
    method _connect (line 3638) | def _connect(self):
    method _add_conn_hooks (line 3650) | def _add_conn_hooks(self, conn):
    method _set_pragmas (line 3663) | def _set_pragmas(self, conn):
    method _attach_databases (line 3669) | def _attach_databases(self, conn):
    method pragma (line 3675) | def pragma(self, key, value=SENTINEL, permanent=False, schema=None):
    method timeout (line 3705) | def timeout(self):
    method timeout (line 3709) | def timeout(self, seconds):
    method _load_aggregates (line 3719) | def _load_aggregates(self, conn):
    method _load_collations (line 3723) | def _load_collations(self, conn):
    method _load_functions (line 3727) | def _load_functions(self, conn):
    method _load_window_functions (line 3732) | def _load_window_functions(self, conn):
    method register_aggregate (line 3736) | def register_aggregate(self, klass, name=None, num_params=-1):
    method aggregate (line 3741) | def aggregate(self, name=None, num_params=-1):
    method register_collation (line 3747) | def register_collation(self, fn, name=None):
    method collation (line 3757) | def collation(self, name=None):
    method register_function (line 3763) | def register_function(self, fn, name=None, num_params=-1,
    method func (line 3769) | def func(self, name=None, num_params=-1, deterministic=None):
    method register_window_function (line 3775) | def register_window_function(self, klass, name=None, num_params=-1):
    method window_function (line 3781) | def window_function(self, name=None, num_params=-1):
    method unregister_aggregate (line 3787) | def unregister_aggregate(self, name):
    method unregister_collation (line 3790) | def unregister_collation(self, name):
    method unregister_function (line 3793) | def unregister_function(self, name):
    method unregister_window_function (line 3796) | def unregister_window_function(self, name):
    method _load_extensions (line 3799) | def _load_extensions(self, conn):
    method load_extension (line 3804) | def load_extension(self, extension):
    method unload_extension (line 3811) | def unload_extension(self, extension):
    method attach (line 3814) | def attach(self, filename, name):
    method detach (line 3825) | def detach(self, name):
    method last_insert_id (line 3834) | def last_insert_id(self, cursor, query_type=None):
    method rows_affected (line 3844) | def rows_affected(self, cursor):
    method begin (line 3850) | def begin(self, lock_type=None):
    method commit (line 3854) | def commit(self):
    method rollback (line 3858) | def rollback(self):
    method get_tables (line 3862) | def get_tables(self, schema=None):
    method get_views (line 3868) | def get_views(self, schema=None):
    method get_indexes (line 3873) | def get_indexes(self, table, schema=None):
    method get_columns (line 3906) | def get_columns(self, table, schema=None):
    method get_primary_keys (line 3912) | def get_primary_keys(self, table, schema=None):
    method get_foreign_keys (line 3917) | def get_foreign_keys(self, table, schema=None):
    method get_binary_type (line 3923) | def get_binary_type(self):
    method conflict_statement (line 3926) | def conflict_statement(self, on_conflict, query):
    method conflict_update (line 3931) | def conflict_update(self, oc, query):
    method extract_date (line 3959) | def extract_date(self, date_part, date_field):
    method truncate_date (line 3962) | def truncate_date(self, date_part, date_field):
    method to_timestamp (line 3966) | def to_timestamp(self, date_field):
    method from_timestamp (line 3969) | def from_timestamp(self, date_field):
  class _BasePsycopgAdapter (line 3973) | class _BasePsycopgAdapter(object):
    method __init__ (line 3976) | def __init__(self):
    method isolation_level_int (line 3980) | def isolation_level_int(self, isolation_level):
    method isolation_level_str (line 3985) | def isolation_level_str(self, isolation_level):
  class Psycopg2Adapter (line 3991) | class Psycopg2Adapter(_BasePsycopgAdapter):
    method __init__ (line 3999) | def __init__(self):
    method check_driver (line 4005) | def check_driver(self):
    method get_binary_type (line 4009) | def get_binary_type(self):
    method connect (line 4012) | def connect(self, db, **params):
    method get_server_version (line 4026) | def get_server_version(self, conn):
    method is_connection_usable (line 4029) | def is_connection_usable(self, conn):
    method is_connection_reusable (line 4033) | def is_connection_reusable(self, conn):
    method is_connection_closed (line 4046) | def is_connection_closed(self, conn):
  class Psycopg3Adapter (line 4055) | class Psycopg3Adapter(_BasePsycopgAdapter):
    method __init__ (line 4063) | def __init__(self):
    method check_driver (line 4069) | def check_driver(self):
    method get_binary_type (line 4073) | def get_binary_type(self):
    method connect (line 4076) | def connect(self, db, **params):
    method get_server_version (line 4083) | def get_server_version(self, conn):
    method is_connection_usable (line 4086) | def is_connection_usable(self, conn):
    method is_connection_reusable (line 4089) | def is_connection_reusable(self, conn):
    method is_connection_closed (line 4102) | def is_connection_closed(self, conn):
  class PostgresqlDatabase (line 4111) | class PostgresqlDatabase(Database):
    method init (line 4134) | def init(self, database, register_unicode=True, encoding=None,
    method _connect (line 4152) | def _connect(self):
    method _set_server_version (line 4165) | def _set_server_version(self, conn):
    method is_connection_usable (line 4168) | def is_connection_usable(self):
    method last_insert_id (line 4177) | def last_insert_id(self, cursor, query_type=None):
    method rows_affected (line 4183) | def rows_affected(self, cursor):
    method begin (line 4189) | def begin(self, isolation_level=None):
    method get_tables (line 4200) | def get_tables(self, schema=None):
    method get_views (line 4206) | def get_views(self, schema=None):
    method get_indexes (line 4213) | def get_indexes(self, table, schema=None):
    method get_columns (line 4233) | def get_columns(self, table, schema=None):
    method get_primary_keys (line 4244) | def get_primary_keys(self, table, schema=None):
    method get_foreign_keys (line 4260) | def get_foreign_keys(self, table, schema=None):
    method sequence_exists (line 4281) | def sequence_exists(self, sequence):
    method get_binary_type (line 4289) | def get_binary_type(self):
    method conflict_statement (line 4292) | def conflict_statement(self, on_conflict, query):
    method conflict_update (line 4295) | def conflict_update(self, oc, query):
    method extract_date (line 4320) | def extract_date(self, date_part, date_field):
    method truncate_date (line 4323) | def truncate_date(self, date_part, date_field):
    method interval (line 4326) | def interval(self, val):
    method to_timestamp (line 4329) | def to_timestamp(self, date_field):
    method from_timestamp (line 4332) | def from_timestamp(self, date_field):
    method get_noop_select (line 4336) | def get_noop_select(self, ctx):
    method set_time_zone (line 4339) | def set_time_zone(self, timezone):
    method set_isolation_level (line 4342) | def set_isolation_level(self, isolation_level):
  class MySQLDatabase (line 4347) | class MySQLDatabase(Database):
    method init (line 4374) | def init(self, database, **kwargs):
    method _connect (line 4384) | def _connect(self):
    method _set_server_version (line 4391) | def _set_server_version(self, conn):
    method _extract_server_version (line 4398) | def _extract_server_version(self, version):
    method is_connection_usable (line 4412) | def is_connection_usable(self):
    method default_values_insert (line 4428) | def default_values_insert(self, ctx):
    method begin (line 4431) | def begin(self, isolation_level=None):
    method get_tables (line 4441) | def get_tables(self, schema=None):
    method get_views (line 4447) | def get_views(self, schema=None):
    method get_indexes (line 4454) | def get_indexes(self, table, schema=None):
    method get_columns (line 4466) | def get_columns(self, table, schema=None):
    method get_primary_keys (line 4477) | def get_primary_keys(self, table, schema=None):
    method get_foreign_keys (line 4482) | def get_foreign_keys(self, table, schema=None):
    method get_binary_type (line 4495) | def get_binary_type(self):
    method conflict_statement (line 4498) | def conflict_statement(self, on_conflict, query):
    method conflict_update (line 4510) | def conflict_update(self, on_conflict, query):
    method extract_date (line 4553) | def extract_date(self, date_part, date_field):
    method truncate_date (line 4556) | def truncate_date(self, date_part, date_field):
    method to_timestamp (line 4560) | def to_timestamp(self, date_field):
    method from_timestamp (line 4563) | def from_timestamp(self, date_field):
    method random (line 4566) | def random(self):
    method get_noop_select (line 4569) | def get_noop_select(self, ctx):
  class _manual (line 4576) | class _manual(object):
    method __init__ (line 4577) | def __init__(self, db):
    method __call__ (line 4580) | def __call__(self, fn):
    method __enter__ (line 4587) | def __enter__(self):
    method __exit__ (line 4594) | def __exit__(self, exc_type, exc_val, exc_tb):
  class _atomic (line 4600) | class _atomic(object):
    method __init__ (line 4601) | def __init__(self, db, *args, **kwargs):
    method __call__ (line 4605) | def __call__(self, fn):
    method __enter__ (line 4613) | def __enter__(self):
    method __exit__ (line 4624) | def __exit__(self, exc_type, exc_val, exc_tb):
  class _transaction (line 4628) | class _transaction(object):
    method __init__ (line 4629) | def __init__(self, db, *args, **kwargs):
    method __call__ (line 4633) | def __call__(self, fn):
    method _begin (line 4641) | def _begin(self):
    method commit (line 4645) | def commit(self, begin=True):
    method rollback (line 4650) | def rollback(self, begin=True):
    method __enter__ (line 4655) | def __enter__(self):
    method __exit__ (line 4661) | def __exit__(self, exc_type, exc_val, exc_tb):
  class _savepoint (line 4674) | class _savepoint(object):
    method __init__ (line 4675) | def __init__(self, db, sid=None):
    method __call__ (line 4680) | def __call__(self, fn):
    method _begin (line 4687) | def _begin(self):
    method commit (line 4690) | def commit(self, begin=True):
    method rollback (line 4694) | def rollback(self, begin=True):
    method __enter__ (line 4698) | def __enter__(self):
    method __exit__ (line 4702) | def __exit__(self, exc_type, exc_val, exc_tb):
  class CursorWrapper (line 4716) | class CursorWrapper(object):
    method __init__ (line 4717) | def __init__(self, cursor):
    method __iter__ (line 4725) | def __iter__(self):
    method __getitem__ (line 4730) | def __getitem__(self, item):
    method __len__ (line 4745) | def __len__(self):
    method initialize (line 4749) | def initialize(self):
    method iterate (line 4752) | def iterate(self, cache=True):
    method process_row (line 4767) | def process_row(self, row):
    method iterator (line 4770) | def iterator(self):
    method fill_cache (line 4778) | def fill_cache(self, n=0):
    method dedupe_columns (line 4794) | def dedupe_columns(self, columns, valid_identifiers=True):
  class DictCursorWrapper (line 4814) | class DictCursorWrapper(CursorWrapper):
    method initialize (line 4815) | def initialize(self):
    method _row_to_dict (line 4821) | def _row_to_dict(self, row):
  class NamedTupleCursorWrapper (line 4829) | class NamedTupleCursorWrapper(CursorWrapper):
    method initialize (line 4830) | def initialize(self):
    method process_row (line 4835) | def process_row(self, row):
  class ObjectCursorWrapper (line 4839) | class ObjectCursorWrapper(DictCursorWrapper):
    method __init__ (line 4840) | def __init__(self, cursor, constructor):
    method initialize (line 4844) | def initialize(self):
    method process_row (line 4850) | def process_row(self, row):
  class ResultIterator (line 4855) | class ResultIterator(object):
    method __init__ (line 4856) | def __init__(self, cursor_wrapper):
    method __iter__ (line 4860) | def __iter__(self):
    method next (line 4863) | def next(self):
  class FieldAccessor (line 4878) | class FieldAccessor(object):
    method __init__ (line 4879) | def __init__(self, model, field, name):
    method __get__ (line 4884) | def __get__(self, instance, instance_type=None):
    method __set__ (line 4892) | def __set__(self, instance, value):
  class ForeignKeyAccessor (line 4897) | class ForeignKeyAccessor(FieldAccessor):
    method __init__ (line 4898) | def __init__(self, model, field, name):
    method get_rel_instance (line 4902) | def get_rel_instance(self, instance):
    method __get__ (line 4913) | def __get__(self, instance, instance_type=None):
    method __set__ (line 4918) | def __set__(self, instance, obj):
  class BackrefAccessor (line 4931) | class BackrefAccessor(object):
    method __init__ (line 4932) | def __init__(self, field):
    method __get__ (line 4937) | def __get__(self, instance, instance_type=None):
  class ObjectIdAccessor (line 4946) | class ObjectIdAccessor(object):
    method __init__ (line 4948) | def __init__(self, field):
    method __get__ (line 4951) | def __get__(self, instance, instance_type=None):
    method __set__ (line 4961) | def __set__(self, instance, value):
  class Field (line 4965) | class Field(ColumnBase):
    method __init__ (line 4974) | def __init__(self, null=False, index=False, unique=False, column_name=...
    method __hash__ (line 5006) | def __hash__(self):
    method __repr__ (line 5009) | def __repr__(self):
    method bind (line 5016) | def bind(self, model, name, set_attribute=True):
    method column (line 5024) | def column(self):
    method adapt (line 5027) | def adapt(self, value):
    method db_value (line 5030) | def db_value(self, value):
    method python_value (line 5033) | def python_value(self, value):
    method to_value (line 5036) | def to_value(self, value, case=False):
    method get_sort_key (line 5039) | def get_sort_key(self, ctx):
    method __sql__ (line 5042) | def __sql__(self, ctx):
    method get_modifiers (line 5045) | def get_modifiers(self):
    method ddl_datatype (line 5048) | def ddl_datatype(self, ctx):
    method ddl (line 5062) | def ddl(self, ctx):
  class AnyField (line 5082) | class AnyField(Field):
  class IntegerField (line 5086) | class IntegerField(Field):
    method adapt (line 5089) | def adapt(self, value):
  class BigIntegerField (line 5096) | class BigIntegerField(IntegerField):
  class SmallIntegerField (line 5100) | class SmallIntegerField(IntegerField):
  class AutoField (line 5104) | class AutoField(IntegerField):
    method __init__ (line 5108) | def __init__(self, *args, **kwargs):
  class BigAutoField (line 5115) | class BigAutoField(AutoField):
  class IdentityField (line 5119) | class IdentityField(AutoField):
    method __init__ (line 5122) | def __init__(self, generate_always=False, **kwargs):
  class PrimaryKeyField (line 5128) | class PrimaryKeyField(AutoField):
    method __init__ (line 5129) | def __init__(self, *args, **kwargs):
  class FloatField (line 5136) | class FloatField(Field):
    method adapt (line 5139) | def adapt(self, value):
  class DoubleField (line 5146) | class DoubleField(FloatField):
  class DecimalField (line 5150) | class DecimalField(Field):
    method __init__ (line 5153) | def __init__(self, max_digits=10, decimal_places=5, auto_round=False,
    method get_modifiers (line 5162) | def get_modifiers(self):
    method db_value (line 5165) | def db_value(self, value):
    method python_value (line 5174) | def python_value(self, value):
  class _StringField (line 5181) | class _StringField(Field):
    method adapt (line 5182) | def adapt(self, value):
    method __add__ (line 5189) | def __add__(self, other): return StringExpression(self, OP.CONCAT, other)
    method __radd__ (line 5190) | def __radd__(self, other): return StringExpression(other, OP.CONCAT, s...
  class CharField (line 5193) | class CharField(_StringField):
    method __init__ (line 5196) | def __init__(self, max_length=255, *args, **kwargs):
    method get_modifiers (line 5200) | def get_modifiers(self):
  class FixedCharField (line 5204) | class FixedCharField(CharField):
    method adapt (line 5207) | def adapt(self, value):
  class TextField (line 5214) | class TextField(_StringField):
  class FieldDatabaseHook (line 5218) | class FieldDatabaseHook(object):
    method _db_hook (line 5219) | def _db_hook(self, database):
    method bind (line 5222) | def bind(self, model, name, set_attribute=True):
  class BlobField (line 5239) | class BlobField(FieldDatabaseHook, Field):
    method _db_hook (line 5242) | def _db_hook(self, database):
    method db_value (line 5248) | def db_value(self, value):
  class BitField (line 5256) | class BitField(BitwiseMixin, BigIntegerField):
    method __init__ (line 5257) | def __init__(self, *args, **kwargs):
    method flag (line 5262) | def flag(self, value=None):
  class BigBitFieldData (line 5297) | class BigBitFieldData(object):
    method __init__ (line 5298) | def __init__(self, instance, name):
    method clear (line 5308) | def clear(self):
    method _ensure_length (line 5311) | def _ensure_length(self, idx):
    method set_bit (line 5318) | def set_bit(self, idx):
    method clear_bit (line 5322) | def clear_bit(self, idx):
    method toggle_bit (line 5326) | def toggle_bit(self, idx):
    method is_set (line 5331) | def is_set(self, idx):
    method __setitem__ (line 5339) | def __setitem__(self, item, value):
    method __len__ (line 5343) | def __len__(self):
    method _get_compatible_data (line 5346) | def _get_compatible_data(self, other):
    method _bitwise_op (line 5357) | def _bitwise_op(self, other, op):
    method __and__ (line 5370) | def __and__(self, other):
    method __or__ (line 5372) | def __or__(self, other):
    method __xor__ (line 5374) | def __xor__(self, other):
    method __iter__ (line 5377) | def __iter__(self):
    method __repr__ (line 5382) | def __repr__(self):
    method __bytes__ (line 5385) | def __bytes__(self):
  class BigBitFieldAccessor (line 5389) | class BigBitFieldAccessor(FieldAccessor):
    method __get__ (line 5390) | def __get__(self, instance, instance_type=None):
    method __set__ (line 5394) | def __set__(self, instance, value):
  class BigBitField (line 5409) | class BigBitField(BlobField):
    method __init__ (line 5412) | def __init__(self, *args, **kwargs):
    method db_value (line 5416) | def db_value(self, value):
  class UUIDField (line 5420) | class UUIDField(Field):
    method db_value (line 5423) | def db_value(self, value):
    method python_value (line 5437) | def python_value(self, value):
  class BinaryUUIDField (line 5443) | class BinaryUUIDField(BlobField):
    method db_value (line 5446) | def db_value(self, value):
    method python_value (line 5459) | def python_value(self, value):
  function _date_part (line 5469) | def _date_part(date_part):
  function format_date_time (line 5474) | def format_date_time(value, formats, post_process=None):
  function simple_date_time (line 5483) | def simple_date_time(value):
  class _BaseFormattedField (line 5490) | class _BaseFormattedField(Field):
    method __init__ (line 5493) | def __init__(self, formats=None, *args, **kwargs):
  class DateTimeField (line 5499) | class DateTimeField(_BaseFormattedField):
    method adapt (line 5509) | def adapt(self, value):
    method to_timestamp (line 5514) | def to_timestamp(self):
    method truncate (line 5517) | def truncate(self, part):
  class DateField (line 5528) | class DateField(_BaseFormattedField):
    method adapt (line 5536) | def adapt(self, value):
    method to_timestamp (line 5544) | def to_timestamp(self):
    method truncate (line 5547) | def truncate(self, part):
  class TimeField (line 5555) | class TimeField(_BaseFormattedField):
    method adapt (line 5565) | def adapt(self, value):
  function _timestamp_date_part (line 5581) | def _timestamp_date_part(date_part):
  class TimestampField (line 5590) | class TimestampField(BigIntegerField):
    method __init__ (line 5594) | def __init__(self, *args, **kwargs):
    method local_to_utc (line 5611) | def local_to_utc(self, dt):
    method utc_to_local (line 5618) | def utc_to_local(self, dt):
    method get_timestamp (line 5626) | def get_timestamp(self, value):
    method db_value (line 5633) | def db_value(self, value):
    method python_value (line 5650) | def python_value(self, value):
    method from_timestamp (line 5668) | def from_timestamp(self):
  class IPField (line 5681) | class IPField(BigIntegerField):
    method db_value (line 5682) | def db_value(self, val):
    method python_value (line 5686) | def python_value(self, val):
  class BooleanField (line 5691) | class BooleanField(Field):
  class BareField (line 5696) | class BareField(Field):
    method __init__ (line 5697) | def __init__(self, adapt=None, *args, **kwargs):
    method ddl_datatype (line 5702) | def ddl_datatype(self, ctx):
  class ForeignKeyField (line 5706) | class ForeignKeyField(Field):
    method __init__ (line 5710) | def __init__(self, model, field=None, backref=None, on_delete=None,
    method field_type (line 5746) | def field_type(self):
    method get_modifiers (line 5753) | def get_modifiers(self):
    method get_constraint_name (line 5758) | def get_constraint_name(self):
    method adapt (line 5764) | def adapt(self, value):
    method db_value (line 5767) | def db_value(self, value):
    method python_value (line 5772) | def python_value(self, value):
    method bind (line 5777) | def bind(self, model, name, set_attribute=True):
    method foreign_key_constraint (line 5813) | def foreign_key_constraint(self, explicit_name=False):
    method __getattr__ (line 5835) | def __getattr__(self, attr):
  class DeferredForeignKey (line 5845) | class DeferredForeignKey(Field):
    method __init__ (line 5848) | def __init__(self, rel_model_name, **kwargs):
    method __deepcopy__ (line 5859) | def __deepcopy__(self, memo=None):
    method set_model (line 5862) | def set_model(self, rel_model):
    method resolve (line 5871) | def resolve(model_cls):
  class DeferredThroughModel (line 5880) | class DeferredThroughModel(object):
    method __init__ (line 5881) | def __init__(self):
    method set_field (line 5884) | def set_field(self, model, field, name):
    method set_model (line 5887) | def set_model(self, through_model):
  class MetaField (line 5893) | class MetaField(Field):
  class ManyToManyFieldAccessor (line 5898) | class ManyToManyFieldAccessor(FieldAccessor):
    method __init__ (line 5899) | def __init__(self, model, field, name):
    method __get__ (line 5915) | def __get__(self, instance, instance_type=None, force_query=False):
    method __set__ (line 5933) | def __set__(self, instance, value):
  class ManyToManyField (line 5942) | class ManyToManyField(MetaField):
    method __init__ (line 5945) | def __init__(self, model, backref=None, through_model=None, on_delete=...
    method _get_descriptor (line 5963) | def _get_descriptor(self):
    method bind (line 5966) | def bind(self, model, name, set_attribute=True):
    method get_models (line 5984) | def get_models(self):
    method through_model (line 5990) | def through_model(self):
    method through_model (line 5996) | def through_model(self, value):
    method _create_through_model (line 5999) | def _create_through_model(self):
    method get_through_model (line 6020) | def get_through_model(self):
  class VirtualField (line 6025) | class VirtualField(MetaField):
    method __init__ (line 6028) | def __init__(self, field_class=None, *args, **kwargs):
    method db_value (line 6033) | def db_value(self, value):
    method python_value (line 6038) | def python_value(self, value):
    method bind (line 6043) | def bind(self, model, name, set_attribute=True):
  class CompositeKey (line 6049) | class CompositeKey(MetaField):
    method __init__ (line 6052) | def __init__(self, *field_names):
    method safe_field_names (line 6057) | def safe_field_names(self):
    method __get__ (line 6066) | def __get__(self, instance, instance_type=None):
    method __set__ (line 6071) | def __set__(self, instance, value):
    method __eq__ (line 6081) | def __eq__(self, other):
    method __ne__ (line 6086) | def __ne__(self, other):
    method __hash__ (line 6089) | def __hash__(self):
    method __sql__ (line 6092) | def __sql__(self, ctx):
    method bind (line 6100) | def bind(self, model, name, set_attribute=True):
  class _SortedFieldList (line 6106) | class _SortedFieldList(object):
    method __init__ (line 6109) | def __init__(self):
    method __getitem__ (line 6113) | def __getitem__(self, i):
    method __iter__ (line 6116) | def __iter__(self):
    method __contains__ (line 6119) | def __contains__(self, item):
    method index (line 6125) | def index(self, field):
    method insert (line 6128) | def insert(self, item):
    method remove (line 6134) | def remove(self, item):
  class SchemaManager (line 6143) | class SchemaManager(object):
    method __init__ (line 6144) | def __init__(self, model, database=None, **context_options):
    method database (line 6151) | def database(self):
    method database (line 6159) | def database(self, value):
    method _create_context (line 6162) | def _create_context(self):
    method _create_table (line 6165) | def _create_table(self, safe=True, **options):
    method _create_table_option_sql (line 6207) | def _create_table_option_sql(self, options):
    method create_table (line 6222) | def create_table(self, safe=True, **options):
    method _create_table_as (line 6225) | def _create_table_as(self, table_name, query, safe=True, **meta):
    method create_table_as (line 6236) | def create_table_as(self, table_name, query, safe=True, **meta):
    method _drop_table (line 6240) | def _drop_table(self, safe=True, **options):
    method drop_table (line 6250) | def drop_table(self, safe=True, **options):
    method _truncate_table (line 6253) | def _truncate_table(self, restart_identity=False, cascade=False):
    method truncate_table (line 6266) | def truncate_table(self, restart_identity=False, cascade=False):
    method _create_indexes (line 6269) | def _create_indexes(self, safe=True):
    method _create_index (line 6273) | def _create_index(self, index, safe=True):
    method create_indexes (line 6285) | def create_indexes(self, safe=True):
    method _drop_indexes (line 6289) | def _drop_indexes(self, safe=True):
    method _drop_index (line 6294) | def _drop_index(self, index, safe):
    method drop_indexes (line 6307) | def drop_indexes(self, safe=True):
    method _check_sequences (line 6311) | def _check_sequences(self, field):
    method _sequence_for_field (line 6316) | def _sequence_for_field(self, field):
    method _create_sequence (line 6322) | def _create_sequence(self, field):
    method create_sequence (line 6330) | def create_sequence(self, field):
    method _drop_sequence (line 6335) | def _drop_sequence(self, field):
    method drop_sequence (line 6343) | def drop_sequence(self, field):
    method _create_foreign_key (line 6348) | def _create_foreign_key(self, field):
    method create_foreign_key (line 6356) | def create_foreign_key(self, field):
    method create_sequences (line 6359) | def create_sequences(self):
    method create_all (line 6365) | def create_all(self, safe=True, **table_options):
    method drop_sequences (line 6370) | def drop_sequences(self):
    method drop_all (line 6376) | def drop_all(self, safe=True, drop_sequences=True, **options):
  class Metadata (line 6382) | class Metadata(object):
    method __init__ (line 6383) | def __init__(self, model, database=None, table_name=None, indexes=None,
    method make_table_name (line 6450) | def make_table_name(self):
    method model_graph (line 6455) | def model_graph(self, refs=True, backrefs=True, depth_first=True):
    method add_ref (line 6480) | def add_ref(self, field):
    method remove_ref (line 6487) | def remove_ref(self, field):
    method add_manytomany (line 6494) | def add_manytomany(self, field):
    method remove_manytomany (line 6497) | def remove_manytomany(self, field):
    method table (line 6501) | def table(self):
    method table (line 6512) | def table(self, value):
    method table (line 6516) | def table(self):
    method schema (line 6520) | def schema(self):
    method schema (line 6524) | def schema(self, value):
    method entity (line 6529) | def entity(self):
    method _update_sorted_fields (line 6535) | def _update_sorted_fields(self):
    method get_rel_for_model (line 6539) | def get_rel_for_model(self, model):
    method add_field (line 6546) | def add_field(self, field_name, field, set_attribute=True):
    method remove_field (line 6581) | def remove_field(self, field_name):
    method set_primary_key (line 6610) | def set_primary_key(self, name, field):
    method get_primary_keys (line 6618) | def get_primary_keys(self):
    method get_default_dict (line 6625) | def get_default_dict(self):
    method fields_to_index (line 6631) | def fields_to_index(self):
    method set_database (line 6658) | def set_database(self, database):
    method set_table_name (line 6671) | def set_table_name(self, table_name):
  class SubclassAwareMetadata (line 6676) | class SubclassAwareMetadata(Metadata):
    method __init__ (line 6679) | def __init__(self, model, *args, **kwargs):
    method map_models (line 6683) | def map_models(self, fn):
  class DoesNotExist (line 6688) | class DoesNotExist(Exception): pass
  class ModelBase (line 6691) | class ModelBase(type):
    method __new__ (line 6697) | def __new__(cls, name, bases, attrs, **kwargs):
    method __repr__ (line 6788) | def __repr__(self):
    method __iter__ (line 6791) | def __iter__(self):
    method __getitem__ (line 6794) | def __getitem__(self, key):
    method __setitem__ (line 6797) | def __setitem__(self, key, value):
    method __delitem__ (line 6800) | def __delitem__(self, key):
    method __contains__ (line 6803) | def __contains__(self, key):
    method __len__ (line 6811) | def __len__(self):
    method __bool__ (line 6813) | def __bool__(self): return True
    method __sql__ (line 6816) | def __sql__(self, ctx):
  class _BoundModelsContext (line 6820) | class _BoundModelsContext(object):
    method __init__ (line 6821) | def __init__(self, models, database, bind_refs, bind_backrefs):
    method __enter__ (line 6827) | def __enter__(self):
    method __exit__ (line 6835) | def __exit__(self, exc_type, exc_val, exc_tb):
  class Model (line 6841) | class Model(with_metaclass(ModelBase, Node)):
    method __init__ (line 6842) | def __init__(self, *args, **kwargs):
    method __str__ (line 6854) | def __str__(self):
    method validate_model (line 6858) | def validate_model(cls):
    method alias (line 6862) | def alias(cls, alias=None):
    method select (line 6866) | def select(cls, *fields):
    method _normalize_data (line 6873) | def _normalize_data(cls, data, kwargs):
    method update (line 6900) | def update(cls, __data=None, **update):
    method insert (line 6904) | def insert(cls, __data=None, **insert):
    method insert_many (line 6908) | def insert_many(cls, rows, fields=None):
    method insert_from (line 6912) | def insert_from(cls, query, fields):
    method replace (line 6918) | def replace(cls, __data=None, **insert):
    method replace_many (line 6922) | def replace_many(cls, rows, fields=None):
    method raw (line 6928) | def raw(cls, sql, *params):
    method delete (line 6932) | def delete(cls):
    method create (line 6936) | def create(cls, **query):
    method bulk_create (line 6942) | def bulk_create(cls, model_list, batch_size=None):
    method bulk_update (line 6977) | def bulk_update(cls, model_list, fields, batch_size=None):
    method noop (line 7016) | def noop(cls):
    method get (line 7020) | def get(cls, *query, **filters):
    method get_or_none (line 7034) | def get_or_none(cls, *query, **filters):
    method get_by_id (line 7041) | def get_by_id(cls, pk):
    method set_by_id (line 7045) | def set_by_id(cls, key, value):
    method delete_by_id (line 7053) | def delete_by_id(cls, pk):
    method get_or_create (line 7057) | def get_or_create(cls, **kwargs):
    method filter (line 7078) | def filter(cls, *dq_nodes, **filters):
    method get_id (line 7081) | def get_id(self):
    method _pk (line 7092) | def _pk(self, value):
    method _pk_expr (line 7095) | def _pk_expr(self):
    method _prune_fields (line 7098) | def _prune_fields(self, field_dict, only):
    method _populate_unsaved_relations (line 7107) | def _populate_unsaved_relations(self, field_dict):
    method save (line 7118) | def save(self, force_insert=False, only=None):
    method is_dirty (line 7161) | def is_dirty(self):
    method dirty_fields (line 7165) | def dirty_fields(self):
    method dirty_field_names (line 7169) | def dirty_field_names(self):
    method dependencies (line 7173) | def dependencies(self, search_nullable=True, exclude_null_children=Fal...
    method delete_instance (line 7204) | def delete_instance(self, recursive=False, delete_nullable=False):
    method __hash__ (line 7214) | def __hash__(self):
    method __eq__ (line 7217) | def __eq__(self, other):
    method __ne__ (line 7223) | def __ne__(self, other):
    method __sql__ (line 7226) | def __sql__(self, ctx):
    method bind (line 7247) | def bind(cls, database, bind_refs=True, bind_backrefs=True, _exclude=N...
    method bind_ctx (line 7261) | def bind_ctx(cls, database, bind_refs=True, bind_backrefs=True):
    method table_exists (line 7265) | def table_exists(cls):
    method create_table (line 7270) | def create_table(cls, safe=True, **options):
    method drop_table (line 7284) | def drop_table(cls, safe=True, drop_sequences=True, **options):
    method truncate_table (line 7293) | def truncate_table(cls, **options):
    method index (line 7297) | def index(cls, *fields, **kwargs):
    method add_index (line 7301) | def add_index(cls, *fields, **kwargs):
  class ModelAlias (line 7308) | class ModelAlias(Node):
    method __init__ (line 7310) | def __init__(self, model, alias=None):
    method __getattr__ (line 7314) | def __getattr__(self, attr):
    method __setattr__ (line 7333) | def __setattr__(self, attr, value):
    method get_field_aliases (line 7336) | def get_field_aliases(self):
    method select (line 7339) | def select(self, *selection):
    method __call__ (line 7344) | def __call__(self, **kwargs):
    method __sql__ (line 7347) | def __sql__(self, ctx):
  class FieldAlias (line 7366) | class FieldAlias(Field):
    method __init__ (line 7367) | def __init__(self, source, field):
    method create (line 7373) | def create(cls, source, field):
    method clone (line 7378) | def clone(self):
    method adapt (line 7381) | def adapt(self, value): return self.field.adapt(value)
    method python_value (line 7382) | def python_value(self, value): return self.field.python_value(value)
    method db_value (line 7383) | def db_value(self, value): return self.field.db_value(value)
    method __getattr__ (line 7384) | def __getattr__(self, attr):
    method __sql__ (line 7387) | def __sql__(self, ctx):
  function sort_models (line 7391) | def sort_models(models):
  class _ModelQueryHelper (line 7414) | class _ModelQueryHelper(object):
    method __init__ (line 7417) | def __init__(self, *args, **kwargs):
    method objects (line 7423) | def objects(self, constructor=None):
    method models (line 7428) | def models(self):
    method _get_cursor_wrapper (line 7431) | def _get_cursor_wrapper(self, cursor):
    method _get_model_cursor_wrapper (line 7448) | def _get_model_cursor_wrapper(self, cursor):
  class ModelRaw (line 7452) | class ModelRaw(_ModelQueryHelper, RawQuery):
    method __init__ (line 7453) | def __init__(self, model, sql, params, **kwargs):
    method get (line 7458) | def get(self):
  class BaseModelSelect (line 7468) | class BaseModelSelect(_ModelQueryHelper):
    method union_all (line 7469) | def union_all(self, rhs):
    method union (line 7473) | def union(self, rhs):
    method intersect (line 7477) | def intersect(self, rhs):
    method except_ (line 7481) | def except_(self, rhs):
    method __iter__ (line 7485) | def __iter__(self):
    method prefetch (line 7490) | def prefetch(self, *subqueries, **kwargs):
    method get (line 7493) | def get(self, database=None):
    method get_or_none (line 7504) | def get_or_none(self, database=None):
    method group_by (line 7511) | def group_by(self, *columns):
  class ModelCompoundSelectQuery (line 7528) | class ModelCompoundSelectQuery(BaseModelSelect, CompoundSelectQuery):
    method __init__ (line 7529) | def __init__(self, model, *args, **kwargs):
    method _get_model_cursor_wrapper (line 7533) | def _get_model_cursor_wrapper(self, cursor):
  function _normalize_model_select (line 7537) | def _normalize_model_select(fields_or_models):
  class ModelSelect (line 7551) | class ModelSelect(BaseModelSelect, Select):
    method __init__ (line 7552) | def __init__(self, model, fields_or_models, is_default=False):
    method clone (line 7559) | def clone(self):
    method select (line 7564) | def select(self, *fields_or_models):
    method select_extend (line 7571) | def select_extend(self, *columns):
    method switch (line 7576) | def switch(self, ctx=None):
    method _get_model (line 7580) | def _get_model(self, src):
    method _normalize_join (line 7591) | def _normalize_join(self, src, dest, on, attr):
    method _generate_on_clause (line 7658) | def _generate_on_clause(self, src, dest, to_field=None, on=None):
    method join (line 7724) | def join(self, dest, join_type=JOIN.INNER, on=None, src=None, attr=None):
    method left_outer_join (line 7743) | def left_outer_join(self, dest, on=None, src=None, attr=None):
    method join_from (line 7746) | def join_from(self, src, dest, join_type=JOIN.INNER, on=None, attr=None):
    method _get_model_cursor_wrapper (line 7749) | def _get_model_cursor_wrapper(self, cursor):
    method ensure_join (line 7756) | def ensure_join(self, lm, rm, on=None, **join_kwargs):
    method convert_dict_to_node (line 7763) | def convert_dict_to_node(self, qdict):
    method filter (line 7798) | def filter(self, *args, **kwargs):
    method create_table (line 7849) | def create_table(self, name, safe=True, **meta):
    method __sql_selection__ (line 7852) | def __sql_selection__(self, ctx, is_subquery=False):
  class NoopModelSelect (line 7860) | class NoopModelSelect(ModelSelect):
    method __sql__ (line 7861) | def __sql__(self, ctx):
    method _get_cursor_wrapper (line 7864) | def _get_cursor_wrapper(self, cursor):
  class _ModelWriteQueryHelper (line 7868) | class _ModelWriteQueryHelper(_ModelQueryHelper):
    method __init__ (line 7869) | def __init__(self, model, *args, **kwargs):
    method returning (line 7873) | def returning(self, *returning):
    method _set_table_alias (line 7882) | def _set_table_alias(self, ctx):
  class ModelUpdate (line 7887) | class ModelUpdate(_ModelWriteQueryHelper, Update):
  class ModelInsert (line 7891) | class ModelInsert(_ModelWriteQueryHelper, Insert):
    method __init__ (line 7894) | def __init__(self, *args, **kwargs):
    method returning (line 7900) | def returning(self, *returning):
    method get_default_data (line 7909) | def get_default_data(self):
    method get_default_columns (line 7912) | def get_default_columns(self):
  class ModelDelete (line 7917) | class ModelDelete(_ModelWriteQueryHelper, Delete):
  class ManyToManyQuery (line 7921) | class ManyToManyQuery(ModelSelect):
    method __init__ (line 7922) | def __init__(self, instance, accessor, rel, *args, **kwargs):
    method _id_list (line 7929) | def _id_list(self, model_or_id_list):
    method add (line 7934) | def add(self, value, clear_existing=False):
    method remove (line 7957) | def remove(self, value):
    method clear (line 7979) | def clear(self):
  function safe_python_value (line 7987) | def safe_python_value(conv_func):
  class BaseModelCursorWrapper (line 7996) | class BaseModelCursorWrapper(DictCursorWrapper):
    method __init__ (line 7997) | def __init__(self, cursor, model, columns):
    method initialize (line 8002) | def initialize(self):
    method process_row (line 8083) | def process_row(self, row):
  class ModelDictCursorWrapper (line 8087) | class ModelDictCursorWrapper(BaseModelCursorWrapper):
    method initialize (line 8088) | def initialize(self):
    method process_row (line 8094) | def process_row(self, row):
  class ModelTupleCursorWrapper (line 8104) | class ModelTupleCursorWrapper(BaseModelCursorWrapper):
    method process_row (line 8107) | def process_row(self, row):
  class ModelNamedTupleCursorWrapper (line 8114) | class ModelNamedTupleCursorWrapper(ModelTupleCursorWrapper):
    method initialize (line 8115) | def initialize(self):
  class ModelObjectCursorWrapper (line 8122) | class ModelObjectCursorWrapper(ModelDictCursorWrapper):
    method __init__ (line 8123) | def __init__(self, cursor, model, select, constructor):
    method initialize (line 8128) | def initialize(self):
    method process_row (line 8132) | def process_row(self, row):
  class ModelCursorWrapper (line 8149) | class ModelCursorWrapper(BaseModelCursorWrapper):
    method __init__ (line 8150) | def __init__(self, cursor, model, select, from_list, joins, dicts=False):
    method initialize (line 8156) | def initialize(self):
    method process_row (line 8265) | def process_row(self, row):
  class PrefetchQuery (line 8331) | class PrefetchQuery(collections.namedtuple('_PrefetchQuery', (
    method __new__ (line 8333) | def __new__(cls, query, fields=None, is_backref=None, rel_models=None,
    method populate_instance (line 8349) | def populate_instance(self, instance, id_map):
    method store_instance (line 8366) | def store_instance(self, instance, id_map):
  function prefetch_add_subquery (line 8377) | def prefetch_add_subquery(sq, subqueries, prefetch_type):
  function prefetch (line 8454) | def prefetch(sq, *subqueries, **kwargs):

FILE: playhouse/apsw_ext.py
  class APSWDatabase (line 31) | class APSWDatabase(SqliteDatabase):
    method __init__ (line 34) | def __init__(self, database, **kwargs):
    method register_module (line 38) | def register_module(self, mod_name, mod_inst):
    method unregister_module (line 43) | def unregister_module(self, mod_name):
    method _connect (line 46) | def _connect(self):
    method _add_conn_hooks (line 57) | def _add_conn_hooks(self, conn):
    method _load_modules (line 61) | def _load_modules(self, conn):
    method _load_aggregates (line 66) | def _load_aggregates(self, conn):
    method _load_collations (line 72) | def _load_collations(self, conn):
    method _load_functions (line 76) | def _load_functions(self, conn):
    method _load_extensions (line 81) | def _load_extensions(self, conn):
    method load_extension (line 86) | def load_extension(self, extension):
    method last_insert_id (line 93) | def last_insert_id(self, cursor, query_type=None):
    method rows_affected (line 103) | def rows_affected(self, cursor):
    method begin (line 109) | def begin(self, lock_type='deferred'):
    method commit (line 112) | def commit(self):
    method rollback (line 120) | def rollback(self):
  function nh (line 129) | def nh(s, v):
  class BooleanField (line 133) | class BooleanField(_BooleanField):
    method db_value (line 134) | def db_value(self, v):
  class DateField (line 139) | class DateField(_DateField):
  class TimeField (line 142) | class TimeField(_TimeField):
  class DateTimeField (line 145) | class DateTimeField(_DateTimeField):
  class DecimalField (line 148) | class DecimalField(_DecimalField):

FILE: playhouse/cockroachdb.py
  class ExceededMaxAttempts (line 32) | class ExceededMaxAttempts(OperationalError): pass
  class UUIDKeyField (line 35) | class UUIDKeyField(UUIDField):
    method __init__ (line 38) | def __init__(self, *args, **kwargs):
  class RowIDField (line 46) | class RowIDField(AutoField):
    method __init__ (line 49) | def __init__(self, *args, **kwargs):
  class CockroachDatabase (line 56) | class CockroachDatabase(PostgresqlDatabase):
    method __init__ (line 64) | def __init__(self, database, *args, **kwargs):
    method _set_server_version (line 73) | def _set_server_version(self, conn):
    method _get_pk_constraint (line 85) | def _get_pk_constraint(self, table, schema=None):
    method get_indexes (line 95) | def get_indexes(self, table, schema=None):
    method conflict_statement (line 102) | def conflict_statement(self, on_conflict, query):
    method conflict_update (line 113) | def conflict_update(self, oc, query):
    method extract_date (line 133) | def extract_date(self, date_part, date_field):
    method from_timestamp (line 136) | def from_timestamp(self, date_field):
    method begin (line 141) | def begin(self, system_time=None, priority=None):
    method atomic (line 152) | def atomic(self, system_time=None, priority=None):
    method savepoint (line 158) | def savepoint(self):
    method retry_transaction (line 164) | def retry_transaction(self, max_attempts=None, system_time=None,
    method run_transaction (line 174) | def run_transaction(self, cb, max_attempts=None, system_time=None,
  class _crdb_atomic (line 179) | class _crdb_atomic(_atomic):
    method __enter__ (line 180) | def __enter__(self):
  function run_transaction (line 187) | def run_transaction(db, callback, max_attempts=None, system_time=None,
  class PooledCockroachDatabase (line 219) | class PooledCockroachDatabase(_PooledPostgresqlDatabase, CockroachDataba...

FILE: playhouse/cysqlite_ext.py
  function __status__ (line 34) | def __status__(flag, return_highwater=False):
  function __dbstatus__ (line 40) | def __dbstatus__(flag, return_highwater=False, return_current=False):
  class TDecimalField (line 56) | class TDecimalField(DecimalField):
    method get_modifiers (line 59) | def get_modifiers(self): pass
    method db_value (line 61) | def db_value(self, value):
  class CySqliteDatabase (line 66) | class CySqliteDatabase(SqliteDatabase):
    method __init__ (line 67) | def __init__(self, database, rank_functions=True, *args, **kwargs):
    method _connect (line 83) | def _connect(self):
    method _add_conn_hooks (line 95) | def _add_conn_hooks(self, conn):
    method _set_pragmas (line 113) | def _set_pragmas(self, conn):
    method _attach_databases (line 117) | def _attach_databases(self, conn):
    method _load_aggregates (line 121) | def _load_aggregates(self, conn):
    method _load_collations (line 125) | def _load_collations(self, conn):
    method _load_functions (line 129) | def _load_functions(self, conn):
    method _load_window_functions (line 133) | def _load_window_functions(self, conn):
    method register_table_function (line 137) | def register_table_function(self, klass, name=None):
    method unregister_table_function (line 144) | def unregister_table_function(self, name):
    method table_function (line 153) | def table_function(self, name=None):
    method on_commit (line 159) | def on_commit(self, fn):
    method on_rollback (line 165) | def on_rollback(self, fn):
    method on_update (line 171) | def on_update(self, fn):
    method authorizer (line 177) | def authorizer(self, fn):
    method trace (line 183) | def trace(self, fn, mask=2, expand_sql=True):
    method slow_query_log (line 193) | def slow_query_log(self, threshold_ms=50, logger=None,
    method progress (line 206) | def progress(self, fn, n=1):
    method begin (line 216) | def begin(self, lock_type='deferred'):
    method commit (line 220) | def commit(self):
    method rollback (line 224) | def rollback(self):
    method autocommit (line 229) | def autocommit(self):
    method blob_open (line 232) | def blob_open(self, table, column, rowid, read_only=False, dbname=None):
    method backup (line 236) | def backup(self, destination, pages=None, name=None, progress=None,
    method backup_to_file (line 249) | def backup_to_file(self, filename, pages=None, name=None, progress=None,
  class PooledCySqliteDatabase (line 288) | class PooledCySqliteDatabase(_PooledSqliteDatabase, CySqliteDatabase):
  function _sqlite_regexp (line 294) | def _sqlite_regexp(regex, value):

FILE: playhouse/dataset.py
  class DataSet (line 18) | class DataSet(object):
    method __init__ (line 19) | def __init__(self, url, include_views=False, **kwargs):
    method __repr__ (line 52) | def __repr__(self):
    method get_export_formats (line 55) | def get_export_formats(self):
    method get_import_formats (line 61) | def get_import_formats(self):
    method __getitem__ (line 67) | def __getitem__(self, table):
    method tables (line 73) | def tables(self):
    method views (line 80) | def views(self):
    method __contains__ (line 83) | def __contains__(self, table):
    method connect (line 86) | def connect(self, reuse_if_open=False):
    method close (line 89) | def close(self):
    method update_cache (line 92) | def update_cache(self, table=None):
    method get_table_dependencies (line 112) | def get_table_dependencies(self, table):
    method __enter__ (line 125) | def __enter__(self):
    method __exit__ (line 129) | def __exit__(self, exc_type, exc_val, exc_tb):
    method query (line 133) | def query(self, sql, params=None):
    method transaction (line 136) | def transaction(self):
    method _check_arguments (line 139) | def _check_arguments(self, filename, file_obj, format, format_dict):
    method freeze (line 151) | def freeze(self, query, format='csv', filename=None, file_obj=None,
    method thaw (line 168) | def thaw(self, table, format='csv', filename=None, file_obj=None,
  class Table (line 189) | class Table(object):
    method __init__ (line 190) | def __init__(self, dataset, name, model_class):
    method model_class (line 199) | def model_class(self):
    method __repr__ (line 202) | def __repr__(self):
    method __len__ (line 205) | def __len__(self):
    method __iter__ (line 208) | def __iter__(self):
    method _create_model (line 211) | def _create_model(self):
    method create_index (line 219) | def create_index(self, columns, unique=False):
    method _guess_field_type (line 224) | def _guess_field_type(self, value):
    method columns (line 240) | def columns(self):
    method _migrate_new_columns (line 243) | def _migrate_new_columns(self, data):
    method __getitem__ (line 259) | def __getitem__(self, item):
    method __setitem__ (line 265) | def __setitem__(self, item, value):
    method __delitem__ (line 279) | def __delitem__(self, item):
    method insert (line 282) | def insert(self, **data):
    method _apply_where (line 286) | def _apply_where(self, query, filters, conjunction=None):
    method update (line 295) | def update(self, columns=None, conjunction=None, **data):
    method _query (line 307) | def _query(self, **query):
    method find (line 310) | def find(self, **query):
    method find_one (line 313) | def find_one(self, **query):
    method all (line 319) | def all(self):
    method delete (line 322) | def delete(self, **query):
    method freeze (line 325) | def freeze(self, *args, **kwargs):
    method thaw (line 328) | def thaw(self, *args, **kwargs):
  class Exporter (line 332) | class Exporter(object):
    method __init__ (line 333) | def __init__(self, query, iso8601_datetimes=False, base64_bytes=False):
    method export (line 338) | def export(self, file_obj):
  class JSONExporter (line 345) | class JSONExporter(Exporter):
    method _make_default (line 346) | def _make_default(self):
    method export (line 364) | def export(self, file_obj, **kwargs):
  class CSVExporter (line 372) | class CSVExporter(Exporter):
    method export (line 373) | def export(self, file_obj, header=True, **kwargs):
  class TSVExporter (line 399) | class TSVExporter(CSVExporter):
    method export (line 400) | def export(self, file_obj, header=True, **kwargs):
  class Importer (line 405) | class Importer(object):
    method __init__ (line 406) | def __init__(self, table, strict=False, iso8601_datetimes=False,
    method load (line 417) | def load(self, file_obj):
  class JSONImporter (line 421) | class JSONImporter(Importer):
    method load (line 422) | def load(self, file_obj, **kwargs):
  class CSVImporter (line 454) | class CSVImporter(Importer):
    method load (line 455) | def load(self, file_obj, header=True, **kwargs):
  class TSVImporter (line 502) | class TSVImporter(CSVImporter):
    method load (line 503) | def load(self, file_obj, header=True, **kwargs):

FILE: playhouse/db_url.py
  function register_database (line 20) | def register_database(db_class, *names):
  function parseresult_to_dict (line 25) | def parseresult_to_dict(parsed, unquote_password=False, unquote_user=Fal...
  function parse (line 73) | def parse(url, unquote_password=False, unquote_user=False):
  function connect (line 77) | def connect(url, unquote_password=False, unquote_user=False, **connect_p...

FILE: playhouse/fields.py
  class CompressedField (line 14) | class CompressedField(BlobField):
    method __init__ (line 22) | def __init__(self, compression_level=6, algorithm=ZLIB, *args,
    method python_value (line 36) | def python_value(self, value):
    method db_value (line 40) | def db_value(self, value):
  class PickleField (line 46) | class PickleField(BlobField):
    method python_value (line 47) | def python_value(self, value):
    method db_value (line 51) | def db_value(self, value):

FILE: playhouse/flask_utils.py
  class PaginatedQuery (line 15) | class PaginatedQuery(object):
    method __init__ (line 16) | def __init__(self, query_or_model, paginate_by, page_var='page', page=...
    method get_page (line 30) | def get_page(self):
    method get_page_count (line 39) | def get_page_count(self):
    method get_object_list (line 45) | def get_object_list(self):
    method get_page_range (line 50) | def get_page_range(self, page, total, show=5):
  function get_object_or_404 (line 60) | def get_object_or_404(query_or_model, *query):
  function object_list (line 68) | def object_list(template_name, query, context_variable='object_list',
  function get_current_url (line 84) | def get_current_url():
  function get_next_url (line 89) | def get_next_url(default='/'):
  class FlaskDB (line 96) | class FlaskDB(object):
    method __init__ (line 135) | def __init__(self, app=None, database=None, model_class=Model,
    method init_app (line 145) | def init_app(self, app):
    method _load_database (line 165) | def _load_database(self, app, config_value):
    method _load_from_config_dict (line 179) | def _load_from_config_dict(self, config_dict):
    method _register_handlers (line 207) | def _register_handlers(self, app):
    method get_model_class (line 211) | def get_model_class(self):
    method Model (line 222) | def Model(self):
    method connect_db (line 232) | def connect_db(self):
    method close_db (line 237) | def close_db(self, exc):

FILE: playhouse/hybrid.py
  class hybrid_method (line 6) | class hybrid_method(ModelDescriptor):
    method __init__ (line 7) | def __init__(self, func, expr=None):
    method __get__ (line 11) | def __get__(self, instance, instance_type):
    method expression (line 16) | def expression(self, expr):
  class hybrid_property (line 21) | class hybrid_property(ModelDescriptor):
    method __init__ (line 22) | def __init__(self, fget, fset=None, fdel=None, expr=None):
    method __get__ (line 28) | def __get__(self, instance, instance_type):
    method __set__ (line 33) | def __set__(self, instance, value):
    method __delete__ (line 38) | def __delete__(self, instance):
    method setter (line 43) | def setter(self, fset):
    method deleter (line 47) | def deleter(self, fdel):
    method expression (line 51) | def expression(self, expr):

FILE: playhouse/kv.py
  class KeyValue (line 16) | class KeyValue(object):
    method __init__ (line 26) | def __init__(self, key_field=None, value_field=None, ordered=False,
    method create_model (line 58) | def create_model(self):
    method query (line 67) | def query(self, *select):
    method convert_expression (line 73) | def convert_expression(self, expr):
    method __contains__ (line 78) | def __contains__(self, key):
    method __len__ (line 82) | def __len__(self):
    method __getitem__ (line 85) | def __getitem__(self, expr):
    method _upsert (line 96) | def _upsert(self, key, value):
    method _postgres_upsert (line 102) | def _postgres_upsert(self, key, value):
    method __setitem__ (line 109) | def __setitem__(self, expr, value):
    method __delitem__ (line 115) | def __delitem__(self, expr):
    method __iter__ (line 119) | def __iter__(self):
    method keys (line 122) | def keys(self):
    method values (line 125) | def values(self):
    method items (line 128) | def items(self):
    method _update (line 131) | def _update(self, __data=None, **mapping):
    method _postgres_update (line 140) | def _postgres_update(self, __data=None, **mapping):
    method get (line 150) | def get(self, key, default=None):
    method setdefault (line 156) | def setdefault(self, key, default=None):
    method pop (line 163) | def pop(self, key, default=Sentinel):
    method clear (line 175) | def clear(self):

FILE: playhouse/migrate.py
  class Operation (line 138) | class Operation(object):
    method __init__ (line 140) | def __init__(self, migrator, method, *args, **kwargs):
    method execute (line 146) | def execute(self, node):
    method _handle_result (line 149) | def _handle_result(self, result):
    method run (line 158) | def run(self):
  function operation (line 165) | def operation(fn):
  function make_index_name (line 175) | def make_index_name(table_name, columns):
  class SchemaMigrator (line 183) | class SchemaMigrator(object):
    method __init__ (line 187) | def __init__(self, database):
    method make_context (line 190) | def make_context(self):
    method from_database (line 194) | def from_database(cls, database):
    method apply_default (line 206) | def apply_default(self, table, column_name, field):
    method _alter_table (line 221) | def _alter_table(self, ctx, table):
    method _alter_column (line 224) | def _alter_column(self, ctx, table, column):
    method alter_add_column (line 231) | def alter_add_column(self, table, column_name, field):
    method add_constraint (line 252) | def add_constraint(self, table, name, constraint):
    method add_unique (line 261) | def add_unique(self, table, *column_names):
    method drop_constraint (line 269) | def drop_constraint(self, table, name):
    method add_inline_fk_sql (line 275) | def add_inline_fk_sql(self, ctx, field):
    method add_foreign_key_constraint (line 288) | def add_foreign_key_constraint(self, table, column_name, rel, rel_column,
    method add_column (line 314) | def add_column(self, table, column_name, field):
    method drop_foreign_key_constraint (line 353) | def drop_foreign_key_constraint(self, table, column_name):
    method drop_column (line 357) | def drop_column(self, table, column_name, cascade=True):
    method rename_column (line 375) | def rename_column(self, table, old_name, new_name):
    method add_not_null (line 384) | def add_not_null(self, table, column):
    method drop_not_null (line 390) | def drop_not_null(self, table, column):
    method add_column_default (line 396) | def add_column_default(self, table, column, default):
    method drop_column_default (line 414) | def drop_column_default(self, table, column):
    method alter_column_type (line 422) | def alter_column_type(self, table, column, field, cast=None):
    method rename_table (line 436) | def rename_table(self, old_name, new_name):
    method add_index (line 443) | def add_index(self, table, columns, unique=False, using=None):
    method drop_index (line 452) | def drop_index(self, table, index_name):
  class PostgresqlMigrator (line 459) | class PostgresqlMigrator(SchemaMigrator):
    method _primary_key_columns (line 460) | def _primary_key_columns(self, tbl):
    method set_search_path (line 475) | def set_search_path(self, schema_name):
    method rename_table (line 482) | def rename_table(self, old_name, new_name):
  class CockroachDBMigrator (line 506) | class CockroachDBMigrator(PostgresqlMigrator):
    method add_inline_fk_sql (line 509) | def add_inline_fk_sql(self, ctx, field):
    method drop_index (line 513) | def drop_index(self, table, index_name):
  class MySQLColumn (line 521) | class MySQLColumn(namedtuple('_Column', ('name', 'definition', 'null', '...
    method is_pk (line 524) | def is_pk(self):
    method is_unique (line 528) | def is_unique(self):
    method is_null (line 532) | def is_null(self):
    method sql (line 535) | def sql(self, column_name=None, is_null=None):
  class MySQLMigrator (line 556) | class MySQLMigrator(SchemaMigrator):
    method _alter_column (line 560) | def _alter_column(self, ctx, table, column):
    method rename_table (line 567) | def rename_table(self, old_name, new_name):
    method _get_column_definition (line 575) | def _get_column_definition(self, table, column_name):
    method get_foreign_key_constraint (line 585) | def get_foreign_key_constraint(self, table, column_name):
    method drop_foreign_key_constraint (line 603) | def drop_foreign_key_constraint(self, table, column_name):
    method add_inline_fk_sql (line 610) | def add_inline_fk_sql(self, ctx, field):
    method add_not_null (line 614) | def add_not_null(self, table, column):
    method drop_not_null (line 637) | def drop_not_null(self, table, column):
    method rename_column (line 647) | def rename_column(self, table, old_name, new_name):
    method alter_column_type (line 675) | def alter_column_type(self, table, column, field, cast=None):
    method drop_index (line 688) | def drop_index(self, table, index_name):
  class SqliteMigrator (line 697) | class SqliteMigrator(SchemaMigrator):
    method _get_column_names (line 707) | def _get_column_names(self, table):
    method _get_create_table (line 712) | def _get_create_table(self, table):
    method _update_column (line 720) | def _update_column(self, table, column_to_update, fn):
    method _fix_index (line 832) | def _fix_index(self, sql, column_to_update, new_column):
    method drop_column (line 865) | def drop_column(self, table, column_name, cascade=True, legacy=False):
    method rename_column (line 875) | def rename_column(self, table, old_name, new_name, legacy=False):
    method add_not_null (line 896) | def add_not_null(self, table, column):
    method drop_not_null (line 902) | def drop_not_null(self, table, column):
    method add_column_default (line 908) | def add_column_default(self, table, column, default):
    method drop_column_default (line 922) | def drop_column_default(self, table, column):
    method alter_column_type (line 930) | def alter_column_type(self, table, column, field, cast=None):
    method add_constraint (line 942) | def add_constraint(self, table, name, constraint):
    method drop_constraint (line 946) | def drop_constraint(self, table, name):
    method add_foreign_key_constraint (line 950) | def add_foreign_key_constraint(self, table, column_name, field,
  function migrate (line 955) | def migrate(*operations, **kwargs):

FILE: playhouse/mysql_ext.py
  class MySQLConnectorDatabase (line 23) | class MySQLConnectorDatabase(MySQLDatabase):
    method _connect (line 24) | def _connect(self):
    method cursor (line 30) | def cursor(self, named_cursor=None):
    method get_binary_type (line 38) | def get_binary_type(self):
  class PooledMySQLConnectorDatabase (line 42) | class PooledMySQLConnectorDatabase(_PooledMySQLDatabase,
  class MariaDBConnectorDatabase (line 47) | class MariaDBConnectorDatabase(MySQLDatabase):
    method _connect (line 48) | def _connect(self):
    method cursor (line 57) | def cursor(self, named_cursor=None):
    method _set_server_version (line 65) | def _set_server_version(self, conn):
    method last_insert_id (line 73) | def last_insert_id(self, cursor, query_type=None):
    method get_binary_type (line 83) | def get_binary_type(self):
  class PooledMariaDBConnectorDatabase (line 87) | class PooledMariaDBConnectorDatabase(_PooledMySQLDatabase,
  class JSONField (line 92) | class JSONField(TextField):
    method __init__ (line 95) | def __init__(self, json_dumps=None, json_loads=None, **kwargs):
    method python_value (line 100) | def python_value(self, value):
    method db_value (line 107) | def db_value(self, value):
    method extract (line 113) | def extract(self, path):
  function Match (line 117) | def Match(columns, expr, modifier=None):

FILE: playhouse/pool.py
  function make_int (line 15) | def make_int(val):
  class MaxConnectionsExceeded (line 21) | class MaxConnectionsExceeded(ValueError): pass
  class _sentinel (line 27) | class _sentinel(object):
    method __lt__ (line 28) | def __lt__(self, other):
  function locked (line 32) | def locked(fn):
  class PooledDatabase (line 40) | class PooledDatabase(object):
    method __init__ (line 41) | def __init__(self, database, max_connections=20, stale_timeout=None,
    method init (line 74) | def init(self, database, max_connections=None, stale_timeout=None,
    method connect (line 86) | def connect(self, reuse_if_open=False):
    method _connect (line 104) | def _connect(self):
    method _is_stale (line 138) | def _is_stale(self, timestamp):
    method _is_closed (line 143) | def _is_closed(self, conn):
    method _can_reuse (line 146) | def _can_reuse(self, conn):
    method _close_raw (line 150) | def _close_raw(self, conn):
    method _close (line 158) | def _close(self, conn, close_conn=False):
    method manual_close (line 189) | def manual_close(self):
    method close_idle (line 207) | def close_idle(self):
    method close_stale (line 215) | def close_stale(self, age=600):
    method close_all (line 231) | def close_all(self):
  class _PooledMySQLDatabase (line 243) | class _PooledMySQLDatabase(PooledDatabase):
    method _is_closed (line 244) | def _is_closed(self, conn):
  class PooledMySQLDatabase (line 255) | class PooledMySQLDatabase(_PooledMySQLDatabase, MySQLDatabase):
  class _PooledPostgresqlDatabase (line 259) | class _PooledPostgresqlDatabase(PooledDatabase):
    method _is_closed (line 260) | def _is_closed(self, conn):
    method _can_reuse (line 265) | def _can_reuse(self, conn):
  class PooledPostgresqlDatabase (line 268) | class PooledPostgresqlDatabase(_PooledPostgresqlDatabase, PostgresqlData...
  class _PooledSqliteDatabase (line 272) | class _PooledSqliteDatabase(PooledDatabase):
    method _is_closed (line 273) | def _is_closed(self, conn):
  class PooledSqliteDatabase (line 280) | class PooledSqliteDatabase(_PooledSqliteDatabase, SqliteDatabase):

FILE: playhouse/postgres_ext.py
  function register_hstore (line 25) | def register_hstore(*args): pass
  function register_hstore_pg3 (line 31) | def register_hstore_pg3(*args): pass
  class Json (line 58) | class Json(Node):
    method __init__ (line 62) | def __init__(self, value, dumps=None):
    method __sql__ (line 66) | def __sql__(self, ctx):
  class _LookupNode (line 70) | class _LookupNode(ColumnBase):
    method __init__ (line 71) | def __init__(self, node, parts):
    method clone (line 76) | def clone(self):
    method __hash__ (line 79) | def __hash__(self):
  class ObjectSlice (line 83) | class ObjectSlice(_LookupNode):
    method create (line 85) | def create(cls, node, value):
    method __sql__ (line 98) | def __sql__(self, ctx):
    method __getitem__ (line 107) | def __getitem__(self, value):
  class IndexedFieldMixin (line 111) | class IndexedFieldMixin(object):
    method __init__ (line 114) | def __init__(self, *args, **kwargs):
  class ArrayField (line 119) | class ArrayField(IndexedFieldMixin, Field):
    method __init__ (line 122) | def __init__(self, field_class=IntegerField, field_kwargs=None,
    method bind (line 130) | def bind(self, model, name, set_attribute=True):
    method ddl_datatype (line 135) | def ddl_datatype(self, ctx):
    method db_value (line 139) | def db_value(self, value):
    method python_value (line 147) | def python_value(self, value):
    method _process (line 157) | def _process(self, conv, value, dimensions):
    method __getitem__ (line 164) | def __getitem__(self, value):
    method _e (line 167) | def _e(op):
    method contains (line 179) | def contains(self, *items):
    method contains_any (line 182) | def contains_any(self, *items):
    method contained_by (line 185) | def contained_by(self, *items):
  class ArrayValue (line 189) | class ArrayValue(Node):
    method __init__ (line 190) | def __init__(self, field, value):
    method __sql__ (line 194) | def __sql__(self, ctx):
  class DateTimeTZField (line 201) | class DateTimeTZField(DateTimeField):
  class HStoreField (line 205) | class HStoreField(IndexedFieldMixin, Field):
    method __getitem__ (line 209) | def __getitem__(self, key):
    method keys (line 212) | def keys(self):
    method values (line 215) | def values(self):
    method items (line 218) | def items(self):
    method slice (line 221) | def slice(self, *args):
    method exists (line 224) | def exists(self, key):
    method defined (line 227) | def defined(self, key):
    method update (line 230) | def update(self, __data=None, **data):
    method delete (line 235) | def delete(self, *keys):
    method contains (line 239) | def contains(self, value):
    method contains_any (line 248) | def contains_any(self, *keys):
  class _JsonLookupBase (line 252) | class _JsonLookupBase(_LookupNode):
    method __init__ (line 253) | def __init__(self, node, parts, as_json=False):
    method clone (line 258) | def clone(self):
    method as_json (line 262) | def as_json(self, as_json=True):
    method concat (line 265) | def concat(self, rhs):
    method contains (line 270) | def contains(self, other):
    method contained_by (line 275) | def contained_by(self, other):
    method contains_any (line 280) | def contains_any(self, *keys):
    method contains_all (line 286) | def contains_all(self, *keys):
    method has_key (line 292) | def has_key(self, key):
    method remove (line 295) | def remove(self):
    method length (line 300) | def length(self):
    method extract (line 304) | def extract(self, *path):
    method path (line 309) | def path(self, *keys):
  class JsonLookup (line 313) | class JsonLookup(_JsonLookupBase):
    method __getitem__ (line 314) | def __getitem__(self, value):
    method __sql__ (line 317) | def __sql__(self, ctx):
  class JsonPath (line 329) | class JsonPath(_JsonLookupBase):
    method __sql__ (line 330) | def __sql__(self, ctx):
  class JSONField (line 337) | class JSONField(FieldDatabaseHook, Field):
    method __init__ (line 341) | def __init__(self, dumps=None, **kwargs):
    method _db_hook (line 345) | def _db_hook(self, database):
    method db_value (line 360) | def db_value(self, value):
    method to_value (line 365) | def to_value(self, value, case=False):
    method __getitem__ (line 372) | def __getitem__(self, value):
    method path (line 375) | def path(self, *keys):
    method concat (line 378) | def concat(self, value):
    method length (line 383) | def length(self):
    method extract (line 386) | def extract(self, *path):
  class BinaryJSONField (line 391) | class BinaryJSONField(IndexedFieldMixin, JSONField):
    method _db_hook (line 396) | def _db_hook(self, database):
    method contains (line 411) | def contains(self, other):
    method contained_by (line 416) | def contained_by(self, other):
    method contains_any (line 421) | def contains_any(self, *items):
    method contains_all (line 427) | def contains_all(self, *items):
    method has_key (line 433) | def has_key(self, key):
    method remove (line 436) | def remove(self, *items):
    method length (line 440) | def length(self):
    method extract (line 443) | def extract(self, *path):
  class TSVectorField (line 448) | class TSVectorField(IndexedFieldMixin, TextField):
    method match (line 452) | def match(self, query, language=None, plain=False):
  function Match (line 458) | def Match(field, query, language=None):
  class IntervalField (line 467) | class IntervalField(Field):
  class FetchManyCursor (line 471) | class FetchManyCursor(object):
    method __init__ (line 474) | def __init__(self, cursor, array_size=None):
    method description (line 481) | def description(self):
    method close (line 484) | def close(self):
    method row_gen (line 488) | def row_gen(self):
    method fetchone (line 499) | def fetchone(self):
  class ServerSideQuery (line 508) | class ServerSideQuery(Node):
    method __init__ (line 509) | def __init__(self, query, array_size=None):
    method __sql__ (line 514) | def __sql__(self, ctx):
    method __iter__ (line 517) | def __iter__(self):
    method close (line 522) | def close(self):
    method iterator (line 529) | def iterator(self):
    method _execute (line 534) | def _execute(self, database):
  function ServerSide (line 542) | def ServerSide(query, array_size=None):
  class _empty_object (line 548) | class _empty_object(object):
    method __nonzero__ (line 550) | def __nonzero__(self):
  class Psycopg2ExtAdapter (line 555) | class Psycopg2ExtAdapter(Psycopg2Adapter):
    method register_hstore (line 556) | def register_hstore(self, conn):
    method server_side_cursor (line 559) | def server_side_cursor(self, conn):
  class Psycopg3ExtAdapter (line 565) | class Psycopg3ExtAdapter(Psycopg3Adapter):
    method register_hstore (line 566) | def register_hstore(self, conn):
    method server_side_cursor (line 570) | def server_side_cursor(self, conn):
  class PostgresqlExtDatabase (line 574) | class PostgresqlExtDatabase(PostgresqlDatabase):
    method __init__ (line 578) | def __init__(self, *args, **kwargs):
    method _connect (line 583) | def _connect(self):
    method cursor (line 589) | def cursor(self, named_cursor=None):
    method execute (line 599) | def execute(self, query, named_cursor=False, array_size=None,
    method execute_sql (line 610) | def execute_sql(self, sql, params=None, named_cursor=None):
  class PooledPostgresqlExtDatabase (line 618) | class PooledPostgresqlExtDatabase(_PooledPostgresqlDatabase, PostgresqlE...
  class Psycopg3Database (line 622) | class Psycopg3Database(PostgresqlExtDatabase):
    method __init__ (line 623) | def __init__(self, *args, **kwargs):
  class PooledPsycopg3Database (line 628) | class PooledPsycopg3Database(_PooledPostgresqlDatabase, Psycopg3Database):

FILE: playhouse/pwasyncio.py
  class MissingGreenletBridge (line 34) | class MissingGreenletBridge(RuntimeError):
  function greenlet_spawn (line 38) | async def greenlet_spawn(fn, *args, **kwargs):
  function await_ (line 68) | def await_(awaitable):
  class _State (line 76) | class _State(object):
    method __init__ (line 79) | def __init__(self):
    method reset (line 83) | def reset(self):
  class _ConnectionState (line 89) | class _ConnectionState(object):
    method __init__ (line 90) | def __init__(self):
    method _current (line 97) | def _current(self):
    method _on_task_done (line 128) | def _on_task_done(self, task):
    method conn (line 136) | def conn(self):
    method closed (line 140) | def closed(self):
    method transactions (line 144) | def transactions(self):
    method reset (line 147) | def reset(self):
    method set_connection (line 154) | def set_connection(self, conn):
  class _async_transaction_helper (line 160) | class _async_transaction_helper(object):
    method __aenter__ (line 161) | async def __aenter__(self):
    method __aexit__ (line 164) | async def __aexit__(self, exc_typ, exc, tb):
    method acommit (line 167) | async def acommit(self):
    method arollback (line 170) | async def arollback(self):
  class async_atomic (line 174) | class async_atomic(_async_transaction_helper, _atomic): pass
  class async_transaction (line 175) | class async_transaction(_async_transaction_helper, _transaction): pass
  class async_savepoint (line 176) | class async_savepoint(_async_transaction_helper, _savepoint): pass
  class AsyncDatabaseMixin (line 179) | class AsyncDatabaseMixin(object):
    method __init__ (line 180) | def __init__(self, database, **kwargs):
    method execute_sql (line 191) | def execute_sql(self, sql, params=None):
    method aexecute_sql (line 199) | async def aexecute_sql(self, sql, params=None):
    method connect (line 204) | def connect(self):
    method aconnect (line 207) | async def aconnect(self):
    method close (line 225) | def close(self):
    method aclose (line 228) | async def aclose(self):
    method _acquire_conn_async (line 235) | async def _acquire_conn_async(self):
    method _create_pool_async (line 244) | async def _create_pool_async(self):
    method _pool_acquire (line 247) | async def _pool_acquire(self):
    method _pool_release (line 250) | async def _pool_release(self, conn):
    method close_pool (line 253) | async def close_pool(self):
    method _pool_close (line 289) | async def _pool_close(self):
    method __aenter__ (line 292) | async def __aenter__(self):
    method __aexit__ (line 296) | async def __aexit__(self, exc_typ, exc, tb):
    method atomic (line 299) | def atomic(self):
    method transaction (line 302) | def transaction(self):
    method savepoint (line 305) | def savepoint(self):
    method acreate_tables (line 308) | async def acreate_tables(self, *args, **kwargs):
    method adrop_tables (line 311) | async def adrop_tables(self, *args, **kwargs):
    method aexecute (line 314) | async def aexecute(self, query):
    method get (line 318) | async def get(self, query):
    method list (line 321) | async def list(self, query):
    method scalar (line 324) | async def scalar(self, query):
    method count (line 327) | async def count(self, query):
    method exists (line 330) | async def exists(self, query):
    method aprefetch (line 333) | async def aprefetch(self, query, *subqueries):
    method iterate (line 336) | async def iterate(self, query, buffer_size=None):
    method run (line 361) | async def run(self, fn, *args, **kwargs):
    method is_closed (line 364) | def is_closed(self):
  class CursorAdapter (line 371) | class CursorAdapter(object):
    method __init__ (line 374) | def __init__(self, rows=None, lastrowid=None, rowcount=None,
    method fetchone (line 390) | def fetchone(self):
    method _lazy_fetchone (line 399) | def _lazy_fetchone(self):
    method fetchall (line 410) | def fetchall(self):
    method __iter__ (line 415) | def __iter__(self):
    method close (line 420) | def close(self):
    method aclose (line 423) | async def aclose(self):
  function _lazy_cursor_iter (line 432) | def _lazy_cursor_iter(cursor):
  class DummyCursor (line 440) | class DummyCursor(object):
    method __init__ (line 441) | def __init__(self, conn):
    method execute (line 444) | def execute(self, sql, params=None):
    method _async_execute (line 447) | async def _async_execute(self, sql, params):
  class AsyncConnectionWrapper (line 451) | class AsyncConnectionWrapper(object):
    method __init__ (line 452) | def __init__(self, conn):
    method execute (line 456) | async def execute(self, sql, params=None):
    method _execute (line 460) | async def _execute(self, sql, params):
    method cursor (line 463) | def cursor(self):
    method execute_iter (line 466) | async def execute_iter(self, sql, params=None):
    method close (line 469) | async def close(self):
  class AsyncSqlitePool (line 475) | class AsyncSqlitePool(object):
    method __init__ (line 476) | def __init__(self, database, pool_size=5, on_connect=None,
    method initialize (line 486) | async def initialize(self):
    method _create_connection (line 492) | async def _create_connection(self):
    method acquire (line 503) | async def acquire(self, timeout=None):
    method _conn_is_valid (line 508) | def _conn_is_valid(self, conn):
    method release (line 516) | async def release(self, conn):
    method close (line 528) | async def close(self):
  class AsyncSqliteConnection (line 539) | class AsyncSqliteConnection(AsyncConnectionWrapper):
    method _execute (line 540) | async def _execute(self, sql, params=None):
    method execute_iter (line 551) | async def execute_iter(self, sql, params=None):
  class AsyncSqliteDatabase (line 576) | class AsyncSqliteDatabase(AsyncDatabaseMixin, SqliteDatabase):
    method _create_pool_async (line 577) | async def _create_pool_async(self):
    method _add_conn_hooks (line 584) | async def _add_conn_hooks(self, conn):
    method _set_pragmas (line 590) | async def _set_pragmas(self, conn):
    method _load_functions (line 594) | async def _load_functions(self, conn):
    method _pool_acquire (line 599) | async def _pool_acquire(self):
    method _pool_release (line 602) | async def _pool_release(self, conn):
    method _pool_close (line 606) | async def _pool_close(self):
  class AsyncMySQLConnection (line 611) | class AsyncMySQLConnection(AsyncConnectionWrapper):
    method _execute (line 612) | async def _execute(self, sql, params=None):
    method execute_iter (line 626) | async def execute_iter(self, sql, params=None):
  class AsyncMySQLDatabase (line 653) | class AsyncMySQLDatabase(AsyncDatabaseMixin, MySQLDatabase):
    method _create_pool_async (line 654) | async def _create_pool_async(self):
    method _pool_acquire (line 664) | async def _pool_acquire(self):
    method _pool_release (line 670) | async def _pool_release(self, conn):
    method _pool_close (line 674) | async def _pool_close(self):
  class AsyncPostgresqlConnection (line 679) | class AsyncPostgresqlConnection(AsyncConnectionWrapper):
    method _execute (line 680) | async def _execute(self, sql, params=None):
    method execute_iter (line 695) | async def execute_iter(self, sql, params=None):
    method _translate_placeholders (line 732) | def _translate_placeholders(sql):
  class AsyncPgAdapter (line 743) | class AsyncPgAdapter(Psycopg3Adapter):
    method __init__ (line 744) | def __init__(self):
  class AsyncPgAtomic (line 750) | class AsyncPgAtomic(object):
    method __init__ (line 751) | def __init__(self, db, *args, **kwargs):
    method __enter__ (line 755) | def __enter__(self):
    method __exit__ (line 760) | def __exit__(self, exc_type, exc_val, exc_tb):
    method commit (line 771) | def commit(self, begin=True):
    method rollback (line 774) | def rollback(self, begin=True):
    method _abegin (line 777) | async def _abegin(self):
    method acommit (line 784) | async def acommit(self, begin=True):
    method arollback (line 789) | async def arollback(self, begin=True):
    method __aenter__ (line 794) | async def __aenter__(self):
    method __aexit__ (line 799) | async def __aexit__(self, exc_type, exc_val, exc_tb):
  class AsyncPostgresqlDatabase (line 811) | class AsyncPostgresqlDatabase(AsyncDatabaseMixin, PostgresqlDatabase):
    method register_adapters (line 814) | async def register_adapters(self, conn):
    method _create_pool_async (line 832) | async def _create_pool_async(self):
    method _pool_acquire (line 842) | async def _pool_acquire(self):
    method _pool_release (line 848) | async def _pool_release(self, conn):
    method _pool_close (line 852) | async def _pool_close(self):
    method atomic (line 855) | def atomic(self, *args, **kwargs):
    method transaction (line 857) | def transaction(self, *args, **kwargs):
    method savepoint (line 859) | def savepoint(self, *args, **kwargs):

FILE: playhouse/pydantic_utils.py
  function choices_to_literal (line 19) | def choices_to_literal(choices):
  function choices_description (line 22) | def choices_description(choices):
  function get_field_type (line 25) | def get_field_type(field):
  function to_pydantic (line 30) | def to_pydantic(model_cls, exclude=None, include=None, exclude_autofield...

FILE: playhouse/reflection.py
  class UnknownField (line 66) | class UnknownField(object):
  class Column (line 70) | class Column(object):
    method __init__ (line 76) | def __init__(self, name, field_class, raw_column_type, nullable,
    method __repr__ (line 95) | def __repr__(self):
    method get_field_parameters (line 107) | def get_field_parameters(self):
    method is_primary_key (line 140) | def is_primary_key(self):
    method is_foreign_key (line 143) | def is_foreign_key(self):
    method is_self_referential_fk (line 146) | def is_self_referential_fk(self):
    method set_foreign_key (line 150) | def set_foreign_key(self, foreign_key, model_names, dest=None,
    method get_field (line 161) | def get_field(self):
  class Metadata (line 182) | class Metadata(object):
    method __init__ (line 186) | def __init__(self, database):
    method execute (line 190) | def execute(self, sql, *params):
    method get_columns (line 193) | def get_columns(self, table, schema=None):
    method get_column_types (line 227) | def get_column_types(self, table, schema=None):
    method _clean_default (line 230) | def _clean_default(self, field_class, default):
    method get_foreign_keys (line 239) | def get_foreign_keys(self, table, schema=None):
    method get_primary_keys (line 242) | def get_primary_keys(self, table, schema=None):
    method get_indexes (line 245) | def get_indexes(self, table, schema=None):
  class PostgresqlMetadata (line 249) | class PostgresqlMetadata(Metadata):
    method __init__ (line 285) | def __init__(self, database):
    method get_column_types (line 307) | def get_column_types(self, table, schema):
    method get_columns (line 333) | def get_columns(self, table, schema=None):
    method get_foreign_keys (line 337) | def get_foreign_keys(self, table, schema=None):
    method get_primary_keys (line 341) | def get_primary_keys(self, table, schema=None):
    method get_indexes (line 345) | def get_indexes(self, table, schema=None):
  class CockroachDBMetadata (line 350) | class CockroachDBMetadata(PostgresqlMetadata):
    method __init__ (line 359) | def __init__(self, database):
  class MySQLMetadata (line 377) | class MySQLMetadata(Metadata):
    method __init__ (line 404) | def __init__(self, database, **kwargs):
    method get_column_types (line 409) | def get_column_types(self, table, schema=None):
  class SqliteMetadata (line 423) | class SqliteMetadata(Metadata):
    method _map_col (line 457) | def _map_col(self, column_type):
    method get_column_types (line 471) | def get_column_types(self, table, schema=None):
  class DatabaseMetadata (line 489) | class DatabaseMetadata(_DatabaseMetadata):
    method multi_column_indexes (line 490) | def multi_column_indexes(self, table):
    method column_indexes (line 500) | def column_indexes(self, table):
  class Introspector (line 508) | class Introspector(object):
    method __init__ (line 511) | def __init__(self, metadata, schema=None):
    method __repr__ (line 515) | def __repr__(self):
    method from_database (line 519) | def from_database(cls, database, schema=None):
    method get_database_class (line 536) | def get_database_class(self):
    method get_database_name (line 539) | def get_database_name(self):
    method get_database_kwargs (line 542) | def get_database_kwargs(self):
    method get_additional_imports (line 545) | def get_additional_imports(self):
    method make_model_name (line 550) | def make_model_name(self, table, snake_case=True):
    method make_column_name (line 559) | def make_column_name(self, column, is_foreign_key=False, snake_case=Tr...
    method introspect (line 577) | def introspect(self, table_names=None, literal_column_names=False,
    method generate_models (line 701) | def generate_models(self, skip_invalid=False, table_names=None,
  function introspect (line 819) | def introspect(database, schema=None):
  function generate_models (line 824) | def generate_models(database, schema=None, **options):
  function print_model (line 829) | def print_model(model, indexes=True, inline_indexes=False):
  function get_table_sql (line 869) | def get_table_sql(model):
  function print_table_sql (line 882) | def print_table_sql(model):

FILE: playhouse/shortcuts.py
  function model_to_dict (line 13) | def model_to_dict(model, recurse=True, backrefs=False, only=None,
  function update_model_from_dict (line 130) | def update_model_from_dict(instance, data, ignore_unknown=False):
  function dict_to_model (line 172) | def dict_to_model(model_class, data, ignore_unknown=False):
  function insert_where (line 176) | def insert_where(cls, data, where=None):
  class ReconnectMixin (line 210) | class ReconnectMixin(object):
    method __init__ (line 242) | def __init__(self, *args, **kwargs):
    method execute_sql (line 251) | def execute_sql(self, sql, params=None):
    method begin (line 255) | def begin(self, *args, **kwargs):
    method _reconnect (line 259) | def _reconnect(self, func, *args, **kwargs):
  function resolve_multimodel_query (line 286) | def resolve_multimodel_query(query, key='_model_identifier'):
  class ThreadSafeDatabaseMetadata (line 309) | class ThreadSafeDatabaseMetadata(Metadata):
    method __init__ (line 318) | def __init__(self, *args, **kwargs):
    method _get_db (line 326) | def _get_db(self):
    method _set_db (line 328) | def _set_db(self, db):
    method set_database (line 334) | def set_database(self, database):
    method table (line 340) | def table(self):
    method table (line 345) | def table(self, value):
    method table (line 348) | def table(self):

FILE: playhouse/signals.py
  class Signal (line 7) | class Signal(object):
    method __init__ (line 8) | def __init__(self):
    method _flush (line 11) | def _flush(self):
    method connect (line 15) | def connect(self, receiver, name=None, sender=None):
    method disconnect (line 25) | def disconnect(self, receiver=None, name=None, sender=None):
    method __call__ (line 40) | def __call__(self, name=None, sender=None):
    method send (line 46) | def send(self, instance, *args, **kwargs):
  class Model (line 62) | class Model(_Model):
    method __init__ (line 63) | def __init__(self, *args, **kwargs):
    method save (line 67) | def save(self, *args, **kwargs):
    method delete_instance (line 75) | def delete_instance(self, *args, **kwargs):

FILE: playhouse/sqlcipher_ext.py
  class _SqlCipherDatabase (line 63) | class _SqlCipherDatabase(object):
    method _connect (line 66) | def _connect(self):
    method set_passphrase (line 80) | def set_passphrase(self, passphrase):
    method rekey (line 88) | def rekey(self, passphrase):
  class SqlCipherDatabase (line 97) | class SqlCipherDatabase(_SqlCipherDatabase, SqliteDatabase):

FILE: playhouse/sqlite_changelog.py
  class BaseChangeLog (line 5) | class BaseChangeLog(Model):
  class ChangeLog (line 13) | class ChangeLog(object):
    method __init__ (line 55) | def __init__(self, db, table_name='changelog'):
    method _build_column_array (line 59) | def _build_column_array(self, model, use_old, use_new, skip_fields=None):
    method trigger_sql (line 84) | def trigger_sql(self, model, action, skip_fields=None):
    method drop_trigger_sql (line 97) | def drop_trigger_sql(self, model, action):
    method model (line 104) | def model(self):
    method install (line 114) | def install(self, model, skip_fields=None, drop=True, insert=True,

FILE: playhouse/sqlite_ext.py
  class RowIDField (line 34) | class RowIDField(AutoField):
    method bind (line 38) | def bind(self, model, name, *args):
  class DocIDField (line 45) | class DocIDField(RowIDField):
  class AutoIncrementField (line 49) | class AutoIncrementField(AutoField):
    method ddl (line 50) | def ddl(self, ctx):
  class TDecimalField (line 55) | class TDecimalField(DecimalField):
    method get_modifiers (line 57) | def get_modifiers(self): pass
  class ISODateTimeField (line 60) | class ISODateTimeField(DateTimeField):
    method db_value (line 69) | def db_value(self, value):
  class JSONPath (line 74) | class JSONPath(ColumnBase):
    method __init__ (line 75) | def __init__(self, field, path=None):
    method _converter (line 80) | def _converter(self, value):
    method path (line 84) | def path(self):
    method __getitem__ (line 87) | def __getitem__(self, idx):
    method append (line 94) | def append(self, value, as_json=None):
    method _json_operation (line 99) | def _json_operation(self, func, value, as_json=None):
    method insert (line 104) | def insert(self, value, as_json=None):
    method set (line 107) | def set(self, value, as_json=None):
    method replace (line 110) | def replace(self, value, as_json=None):
    method update (line 113) | def update(self, value):
    method remove (line 116) | def remove(self):
    method json_type (line 119) | def json_type(self):
    method length (line 122) | def length(self):
    method children (line 125) | def children(self):
    method tree (line 128) | def tree(self):
    method __sql__ (line 131) | def __sql__(self, ctx):
  class JSONBPath (line 135) | class JSONBPath(JSONPath):
    method append (line 136) | def append(self, value, as_json=None):
    method _json_operation (line 141) | def _json_operation(self, func, value, as_json=None):
    method insert (line 146) | def insert(self, value, as_json=None):
    method set (line 149) | def set(self, value, as_json=None):
    method replace (line 152) | def replace(self, value, as_json=None):
    method update (line 155) | def update(self, value):
    method remove (line 158) | def remove(self):
    method __sql__ (line 161) | def __sql__(self, ctx):
  class JSONField (line 166) | class JSONField(TextField):
    method __init__ (line 171) | def __init__(self, json_dumps=None, json_loads=None, **kwargs):
    method python_value (line 176) | def python_value(self, value):
    method db_value (line 183) | def db_value(self, value):
    method _e (line 189) | def _e(op):
    method __getitem__ (line 203) | def __getitem__(self, item):
    method extract (line 206) | def extract(self, *paths):
    method extract_json (line 209) | def extract_json(self, path):
    method extract_text (line 211) | def extract_text(self, path):
    method append (line 214) | def append(self, value, as_json=None):
    method insert (line 217) | def insert(self, value, as_json=None):
    method set (line 220) | def set(self, value, as_json=None):
    method replace (line 223) | def replace(self, value, as_json=None):
    method update (line 226) | def update(self, data):
    method remove (line 229) | def remove(self, *paths):
    method json_type (line 234) | def json_type(self):
    method length (line 237) | def length(self, path=None):
    method children (line 241) | def children(self):
    method tree (line 258) | def tree(self):
  class JSONBField (line 262) | class JSONBField(JSONField):
    method db_value (line 266) | def db_value(self, value):
    method json (line 272) | def json(self):
    method extract (line 275) | def extract(self, *paths):
    method remove (line 279) | def remove(self, *paths):
  class SearchField (line 285) | class SearchField(Field):
    method __init__ (line 286) | def __init__(self, unindexed=False, column_name=None, **k):
    method match (line 293) | def match(self, term):
    method fts_column_index (line 297) | def fts_column_index(self):
    method highlight (line 304) | def highlight(self, left, right):
    method snippet (line 308) | def snippet(self, left, right, over_length='...', max_tokens=16):
  class VirtualTableSchemaManager (line 316) | class VirtualTableSchemaManager(SchemaManager):
    method _create_virtual_table (line 317) | def _create_virtual_table(self, safe=True, **options):
    method _create_table (line 360) | def _create_table(self, safe=True, **options):
  class VirtualModel (line 368) | class VirtualModel(Model):
    class Meta (line 369) | class Meta:
    method clean_options (line 377) | def clean_options(cls, options):
  class BaseFTSModel (line 381) | class BaseFTSModel(VirtualModel):
    method clean_options (line 383) | def clean_options(cls, options):
  class FTSModel (line 413) | class FTSModel(BaseFTSModel):
    class Meta (line 422) | class Meta:
    method _fts_cmd (line 426) | def _fts_cmd(cls, cmd):
    method optimize (line 433) | def optimize(cls):
    method rebuild (line 437) | def rebuild(cls):
    method integrity_check (line 441) | def integrity_check(cls):
    method merge (line 445) | def merge(cls, blocks=200, segments=8):
    method automerge (line 449) | def automerge(cls, state=True):
    method match (line 453) | def match(cls, term):
    method rank (line 460) | def rank(cls, *weights):
    method bm25 (line 465) | def bm25(cls, *weights):
    method bm25f (line 470) | def bm25f(cls, *weights):
    method lucene (line 475) | def lucene(cls, *weights):
    method _search (line 480) | def _search(cls, term, weights, with_score, score_alias, score_fn,
    method search (line 508) | def search(cls, term, weights=None, with_score=False, score_alias='sco...
    method search_bm25 (line 520) | def search_bm25(cls, term, weights=None, with_score=False,
    method search_bm25f (line 532) | def search_bm25f(cls, term, weights=None, with_score=False,
    method search_lucene (line 544) | def search_lucene(cls, term, weights=None, with_score=False,
  class FTS5Model (line 567) | class FTS5Model(BaseFTSModel):
    class Meta (line 625) | class Meta:
    method validate_model (line 636) | def validate_model(cls):
    method fts5_installed (line 647) | def fts5_installed(cls):
    method validate_query (line 669) | def validate_query(query):
    method clean_query (line 684) | def clean_query(query, replace=chr(26)):
    method match (line 708) | def match(cls, term):
    method rank (line 715) | def rank(cls, *args):
    method bm25 (line 719) | def bm25(cls, *weights):
    method search (line 723) | def search(cls, term, weights=None, with_score=False, score_alias='sco...
    method search_bm25 (line 734) | def search_bm25(cls, term, weights=None, with_score=False,
    method _fts_cmd_sql (line 762) | def _fts_cmd_sql(cls, cmd, **extra_params):
    method _fts_cmd (line 778) | def _fts_cmd(cls, cmd, **extra_params):
    method automerge (line 783) | def automerge(cls, level):
    method merge (line 789) | def merge(cls, npages):
    method optimize (line 793) | def optimize(cls):
    method rebuild (line 797) | def rebuild(cls):
    method set_pgsz (line 801) | def set_pgsz(cls, pgsz):
    method set_rank (line 805) | def set_rank(cls, rank_expression):
    method delete_all (line 809) | def delete_all(cls):
    method integrity_check (line 813) | def integrity_check(cls, rank=0):
    method VocabModel (line 817) | def VocabModel(cls, table_type='row', table=None):
  function match (line 852) | def match(lhs, rhs):

FILE: playhouse/sqlite_udf.py
  function format_date_time_sqlite (line 31) | def format_date_time_sqlite(date_value):
  class synchronized_dict (line 54) | class synchronized_dict(dict):
    method __init__ (line 55) | def __init__(self, *args, **kwargs):
    method __getitem__ (line 59) | def __getitem__(self, key):
    method __setitem__ (line 63) | def __setitem__(self, key, value):
    method __delitem__ (line 67) | def __delitem__(self, key):
  function aggregate (line 76) | def aggregate(*groups):
  function udf (line 84) | def udf(group, name=None):
  function register_aggregate_groups (line 92) | def register_aggregate_groups(db, *groups):
  function register_udf_groups (line 102) | def register_udf_groups(db, *groups):
  function register_groups (line 111) | def register_groups(db, *groups):
  function register_all (line 115) | def register_all(db):
  function if_then_else (line 124) | def if_then_else(cond, truthy, falsey=None):
  function strip_tz (line 130) | def strip_tz(date_str):
  function human_delta (line 141) | def human_delta(nseconds, glue=', '):
  function file_ext (line 162) | def file_ext(filename):
  function file_read (line 170) | def file_read(filename):
  function gzip (line 178) | def gzip(data, compression=9):
  function gunzip (line 184) | def gunzip(data):
  function hostname (line 188) | def hostname(url):
  function toggle (line 194) | def toggle(key):
  function setting (line 200) | def setting(key, value=None):
  function clear_settings (line 208) | def clear_settings():
  function clear_toggles (line 212) | def clear_toggles():
  function randomrange (line 216) | def randomrange(start, end=None, step=None):
  function gauss_distribution (line 224) | def gauss_distribution(mean, sigma):
  function sqrt (line 231) | def sqrt(n):
  function tonumber (line 238) | def tonumber(s):
  function substr_count (line 248) | def substr_count(haystack, needle):
  function strip_chars (line 254) | def strip_chars(haystack, chars):
  function json_contains (line 258) | def json_contains(src_json, obj_json):
  class _heap_agg (line 297) | class _heap_agg(object):
    method __init__ (line 298) | def __init__(self):
    method process (line 302) | def process(self, value):
    method step (line 305) | def step(self, value):
  class _datetime_heap_agg (line 309) | class _datetime_heap_agg(_heap_agg):
    method process (line 310) | def process(self, value):
  class mintdiff (line 314) | class mintdiff(_datetime_heap_agg):
    method finalize (line 315) | def finalize(self):
  class avgtdiff (line 331) | class avgtdiff(_datetime_heap_agg):
    method finalize (line 332) | def finalize(self):
  class duration (line 355) | class duration(object):
    method __init__ (line 356) | def __init__(self):
    method step (line 359) | def step(self, value):
    method finalize (line 366) | def finalize(self):
  class mode (line 373) | class mode(object):
    method __init__ (line 374) | def __init__(self):
    method step (line 377) | def step(self, *args):
    method finalize (line 380) | def finalize(self):
  class minrange (line 385) | class minrange(_heap_agg):
    method finalize (line 386) | def finalize(self):
  class avgrange (line 407) | class avgrange(_heap_agg):
    method finalize (line 408) | def finalize(self):
  class _range (line 431) | class _range(object):
    method __init__ (line 434) | def __init__(self):
    method step (line 437) | def step(self, value):
    method finalize (line 443) | def finalize(self):
  class stddev (line 449) | class stddev(object):
    method __init__ (line 450) | def __init__(self):
    method step (line 453) | def step(self, v):
    method finalize (line 456) | def finalize(self):
  function _parse_match_info (line 463) | def _parse_match_info(buf):
  function get_weights (line 468) | def get_weights(ncol, raw_weights):
  function rank (line 478) | def rank(raw_match_info, *raw_weights):
  function bm25 (line 514) | def bm25(raw_match_info, *args):

FILE: playhouse/sqliteq.py
  class ResultTimeout (line 24) | class ResultTimeout(Exception):
  class WriterPaused (line 27) | class WriterPaused(Exception):
  class ShutdownException (line 30) | class ShutdownException(Exception):
  class AsyncCursor (line 34) | class AsyncCursor(object):
    method __init__ (line 38) | def __init__(self, event, sql, params, timeout):
    method set_result (line 46) | def set_result(self, cursor, exc=None):
    method _wait (line 54) | def _wait(self, timeout=None):
    method __iter__ (line 62) | def __iter__(self):
    method next (line 69) | def next(self):
    method lastrowid (line 82) | def lastrowid(self):
    method rowcount (line 88) | def rowcount(self):
    method description (line 94) | def description(self):
    method close (line 99) | def close(self):
    method fetchall (line 104) | def fetchall(self):
    method fetchone (line 107) | def fetchone(self):
  class Writer (line 121) | class Writer(object):
    method __init__ (line 124) | def __init__(self, database, queue):
    method run (line 128) | def run(self):
    method wait_unpause (line 146) | def wait_unpause(self):
    method loop (line 161) | def loop(self, conn):
    method execute (line 180) | def execute(self, obj):
  class SqliteQueueDatabase (line 192) | class SqliteQueueDatabase(SqliteDatabase):
    method __init__ (line 199) | def __init__(self, database, use_gevent=False, autostart=True,
    method get_thread_impl (line 231) | def get_thread_impl(self, use_gevent):
    method _validate_journal_mode (line 234) | def _validate_journal_mode(self, pragmas=None):
    method _create_write_queue (line 246) | def _create_write_queue(self):
    method queue_size (line 249) | def queue_size(self):
    method execute_sql (line 252) | def execute_sql(self, sql, params=None, timeout=None):
    method start (line 264) | def start(self):
    method stop (line 277) | def stop(self):
    method is_stopped (line 299) | def is_stopped(self):
    method pause (line 303) | def pause(self):
    method unpause (line 313) | def unpause(self):
    method __unsupported__ (line 323) | def __unsupported__(self, *args, **kwargs):
  class ThreadHelper (line 328) | class ThreadHelper(object):
    method __init__ (line 331) | def __init__(self, queue_max_size=None):
    method event (line 334) | def event(self): return Event()
    method queue (line 336) | def queue(self, max_size=None):
    method thread (line 340) | def thread(self, fn, *args, **kwargs):
  class GreenletHelper (line 346) | class GreenletHelper(ThreadHelper):
    method event (line 349) | def event(self): return GEvent()
    method queue (line 351) | def queue(self, max_size=None):
    method thread (line 355) | def thread(self, fn, *args, **kwargs):

FILE: playhouse/test_utils.py
  class _QueryLogHandler (line 8) | class _QueryLogHandler(logging.Handler):
    method __init__ (line 9) | def __init__(self, *args, **kwargs):
    method emit (line 13) | def emit(self, record):
  class count_queries (line 19) | class count_queries(object):
    method __init__ (line 20) | def __init__(self, only_select=False):
    method get_queries (line 24) | def get_queries(self):
    method __enter__ (line 27) | def __enter__(self):
    method __exit__ (line 33) | def __exit__(self, exc_type, exc_val, exc_tb):
  class assert_query_count (line 42) | class assert_query_count(count_queries):
    method __init__ (line 43) | def __init__(self, expected, only_select=False):
    method __call__ (line 47) | def __call__(self, f):
    method _assert_count (line 58) | def _assert_count(self):
    method __exit__ (line 62) | def __exit__(self, exc_type, exc_val, exc_tb):

FILE: pwiz.py
  function make_introspector (line 42) | def make_introspector(database_type, database_name, **kwargs):
  function print_models (line 53) | def print_models(introspector, tables=None, preserve_order=False,
  function print_header (line 148) | def print_header(cmd_line, introspector):
  function err (line 158) | def err(msg):
  function get_option_parser (line 162) | def get_option_parser():
  function get_connect_kwargs (line 190) | def get_connect_kwargs(options):
  function main (line 197) | def main():

FILE: runtests.py
  function runtests (line 12) | def runtests(suite, verbosity=1, failfast=False):
  function get_option_parser (line 17) | def get_option_parser():
  function collect_tests (line 70) | def collect_tests(args):
  function collect_asyncio_tests (line 85) | def collect_asyncio_tests():

FILE: tests/apsw_ext.py
  class User (line 12) | class User(TestModel):
  class Message (line 16) | class Message(TestModel):
  class VTSource (line 23) | class VTSource(object):
    method Create (line 24) | def Create(self, db, modulename, dbname, tablename, *args):
  class VTable (line 28) | class VTable(object):
    method BestIndex (line 29) | def BestIndex(self, *args):
    method Open (line 31) | def Open(self):
    method Disconnect (line 33) | def Disconnect(self): pass
  class VTCursor (line 35) | class VTCursor(object):
    method Filter (line 36) | def Filter(self, *a):
    method Eof (line 38) | def Eof(self): return False
    method Rowid (line 39) | def Rowid(self):
    method Column (line 41) | def Column(self, col):
    method Next (line 43) | def Next(self):
    method Close (line 45) | def Close(self): pass
  class TestAPSWExtension (line 48) | class TestAPSWExtension(ModelTestCase):
    method test_db_register_module (line 52) | def test_db_register_module(self):
    method test_db_register_function (line 59) | def test_db_register_function(self):
    method test_db_register_aggregate (line 67) | def test_db_register_aggregate(self):
    method test_db_register_collation (line 87) | def test_db_register_collation(self):
    method test_db_pragmas (line 104) | def test_db_pragmas(self):
    method test_select_insert (line 113) | def test_select_insert(self):
    method test_update_delete (line 133) | def test_update_delete(self):
    method test_transaction_handling (line 146) | def test_transaction_handling(self):
    method test_exists_regression (line 186) | def test_exists_regression(self):

FILE: tests/base.py
  function db_loader (line 24) | def db_loader(engine, name='peewee_test', db_class=None, **params):
  function get_in_memory_db (line 52) | def get_in_memory_db(**params):
  function get_sqlite_db (line 56) | def get_sqlite_db():
  function make_db_params (line 92) | def make_db_params(key):
  function new_connection (line 116) | def new_connection(**kwargs):
  class TestModel (line 156) | class TestModel(Model):
    class Meta (line 157) | class Meta:
  function __sql__ (line 162) | def __sql__(q, **state):
  class QueryLogHandler (line 166) | class QueryLogHandler(logging.Handler):
    method __init__ (line 167) | def __init__(self, *args, **kwargs):
    method emit (line 171) | def emit(self, record):
  class BaseTestCase (line 175) | class BaseTestCase(unittest.TestCase):
    method setUp (line 176) | def setUp(self):
    method tearDown (line 181) | def tearDown(self):
    method assertIsNone (line 184) | def assertIsNone(self, value):
    method assertIsNotNone (line 187) | def assertIsNotNone(self, value):
    method assertRaisesCtx (line 191) | def assertRaisesCtx(self, exceptions):
    method assertSQL (line 200) | def assertSQL(self, query, sql, params=None, **state):
    method assertHistory (line 209) | def assertHistory(self, n, expected):
    method history (line 216) | def history(self):
    method reset_sql_history (line 219) | def reset_sql_history(self):
    method assertQueryCount (line 223) | def assertQueryCount(self, num):
  class DatabaseTestCase (line 229) | class DatabaseTestCase(BaseTestCase):
    method setUp (line 232) | def setUp(self):
    method tearDown (line 238) | def tearDown(self):
    method execute (line 242) | def execute(self, sql, params=None):
  class ModelDatabaseTestCase (line 246) | class ModelDatabaseTestCase(DatabaseTestCase):
    method setUp (line 250) | def setUp(self):
    method tearDown (line 259) | def tearDown(self):
  class ModelTestCase (line 268) | class ModelTestCase(ModelDatabaseTestCase):
    method setUp (line 272) | def setUp(self):
    method tearDown (line 278) | def tearDown(self):
  function requires_models (line 287) | def requires_models(*models):
  function skip_if (line 306) | def skip_if(expr, reason='n/a'):
  function skip_unless (line 311) | def skip_unless(expr, reason='n/a'):
  function slow_test (line 316) | def slow_test():
  function requires_sqlite (line 321) | def requires_sqlite(method):
  function requires_mysql (line 324) | def requires_mysql(method):
  function requires_postgresql (line 327) | def requires_postgresql(method):
  function requires_pglike (line 330) | def requires_pglike(method):

FILE: tests/base_models.py
  class Person (line 6) | class Person(TestModel):
    class Meta (line 11) | class Meta:
  class Note (line 17) | class Note(TestModel):
  class Category (line 22) | class Category(TestModel):
  class Relationship (line 27) | class Relationship(TestModel):
  class Register (line 32) | class Register(TestModel):
  class User (line 36) | class User(TestModel):
    class Meta (line 39) | class Meta:
  class Account (line 43) | class Account(TestModel):
  class Tweet (line 48) | class Tweet(TestModel):
  class Favorite (line 54) | class Favorite(TestModel):
  class Sample (line 59) | class Sample(TestModel):
  class SampleMeta (line 64) | class SampleMeta(TestModel):
  class A (line 69) | class A(TestModel):
  class B (line 71) | class B(TestModel):
  class C (line 74) | class C(TestModel):
  class Emp (line 79) | class Emp(TestModel):
    class Meta (line 84) | class Meta:
  class OCTest (line 90) | class OCTest(TestModel):
  class UKVP (line 96) | class UKVP(TestModel):
    class Meta (line 101) | class Meta:
  class DfltM (line 109) | class DfltM(TestModel):

FILE: tests/cockroachdb.py
  class KV (line 17) | class KV(TestModel):
  class Arr (line 21) | class Arr(TestModel):
  class JsonModel (line 25) | class JsonModel(TestModel):
  class Normal (line 28) | class Normal(TestModel):
  class UID (line 31) | class UID(TestModel):
  class RID (line 35) | class RID(TestModel):
  class UIDNote (line 39) | class UIDNote(TestModel):
  class TestCockroachDatabase (line 45) | class TestCockroachDatabase(ModelTestCase):
    method test_retry_transaction_ok (line 47) | def test_retry_transaction_ok(self):
    method test_retry_transfer_example (line 61) | def test_retry_transfer_example(self):
    method test_retry_transfer_example2 (line 97) | def test_retry_transfer_example2(self):
    method test_retry_transaction_integrityerror (line 126) | def test_retry_transaction_integrityerror(self):
    method test_run_transaction_helper (line 142) | def test_run_transaction_helper(self):
    method test_cannot_nest_run_transaction (line 150) | def test_cannot_nest_run_transaction(self):
    method test_retry_transaction_docs_example (line 160) | def test_retry_transaction_docs_example(self):
    method test_retry_transaction_decorator (line 173) | def test_retry_transaction_decorator(self):
    method test_array_field (line 185) | def test_array_field(self):
    method test_array_field_search (line 203) | def test_array_field_search(self):
    method test_array_field_index (line 236) | def test_array_field_index(self):
    method test_uuid_key_field (line 247) | def test_uuid_key_field(self):
    method test_rowid_field (line 268) | def test_rowid_field(self):
    method test_readonly_transaction (line 280) | def test_readonly_transaction(self):
    method test_transaction_priority (line 299) | def test_transaction_priority(self):
    method test_uuid_key_as_fk (line 314) | def test_uuid_key_as_fk(self):
  class TestCockroachDatabaseJson (line 340) | class TestCockroachDatabaseJson(BaseBinaryJsonFieldTestCase, ModelTestCa...
  class KV2 (line 349) | class KV2(TestModel):
  class Post (line 353) | class Post(TestModel):
  class PostNote (line 357) | class PostNote(TestModel):
  class TestCockroachIntegration (line 363) | class TestCockroachIntegration(ModelTestCase):
    method test_compound_select (line 365) | def test_compound_select(self):
    method test_primary_key_as_foreign_key (line 376) | def test_primary_key_as_foreign_key(self):
  class TestEnsureServerVersionSet (line 392) | class TestEnsureServerVersionSet(ModelTestCase):
    method test_server_version_set (line 396) | def test_server_version_set(self):

FILE: tests/cysqlite_ext.py
  class CyDatabaseTestCase (line 19) | class CyDatabaseTestCase(DatabaseTestCase):
    method tearDown (line 22) | def tearDown(self):
    method execute (line 27) | def execute(self, sql, *params):
  class TestCSqliteHelpers (line 31) | class TestCSqliteHelpers(CyDatabaseTestCase):
    method test_autocommit (line 32) | def test_autocommit(self):
    method test_commit_hook (line 39) | def test_commit_hook(self):
    method test_rollback_hook (line 64) | def test_rollback_hook(self):
    method test_update_hook (line 87) | def test_update_hook(self):
    method test_properties (line 119) | def test_properties(self):
  class TestBackup (line 123) | class TestBackup(CyDatabaseTestCase):
    method tearDown (line 127) | def tearDown(self):
    method _populate_test_data (line 133) | def _populate_test_data(self, nrows=100, db=None):
    method test_backup (line 141) | def test_backup(self):
    method test_backup_preserve_pagesize (line 152) | def test_backup_preserve_pagesize(self):
    method test_backup_to_file (line 167) | def test_backup_to_file(self):
    method test_backup_progress (line 177) | def test_backup_progress(self):
    method test_backup_progress_error (line 193) | def test_backup_progress_error(self):
  class DataTypes (line 205) | class DataTypes(cysqlite.TableFunction):
    method initialize (line 210) | def initialize(self):
    method iterate (line 222) | def iterate(self, idx):
  class TestDataTypesTableFunction (line 229) | class TestDataTypesTableFunction(CyDatabaseTestCase):
    method test_data_types_table_function (line 232) | def test_data_types_table_function(self):

FILE: tests/dataset.py
  class User (line 24) | class User(TestModel):
  class Note (line 27) | class Note(TestModel):
  class Category (line 34) | class Category(TestModel):
  class Bin (line 38) | class Bin(TestModel):
  class TestDataSet (line 43) | class TestDataSet(ModelTestCase):
    method setUp (line 48) | def setUp(self):
    method tearDown (line 55) | def tearDown(self):
    method test_create_index (line 59) | def test_create_index(self):
    method test_pass_database (line 67) | def test_pass_database(self):
    method test_with_views (line 77) | def test_with_views(self):
    method test_item_apis (line 109) | def test_item_apis(self):
    method create_users (line 136) | def create_users(self, n=2):
    method test_special_char_table (line 141) | def test_special_char_table(self):
    method test_column_preservation (line 150) | def test_column_preservation(self):
    method test_case_insensitive (line 160) | def test_case_insensitive(self):
    method test_introspect (line 175) | def test_introspect(self):
    method test_update_cache (line 192) | def test_update_cache(self):
    method assertQuery (line 210) | def assertQuery(self, query, expected, sort_key='id'):
    method test_insert (line 216) | def test_insert(self):
    method test_update (line 242) | def test_update(self):
    method test_delete (line 260) | def test_delete(self):
    method test_find (line 266) | def test_find(self):
    method test_magic_methods (line 301) | def test_magic_methods(self):
    method test_foreign_keys (line 317) | def test_foreign_keys(self):
    method test_transactions (line 364) | def test_transactions(self):
    method test_export (line 395) | def test_export(self):
    method test_freeze_thaw_csv_utf8 (line 411) | def test_freeze_thaw_csv_utf8(self):
    method test_freeze_thaw_json_utf8 (line 414) | def test_freeze_thaw_json_utf8(self):
    method _test_freeze_thaw_utf8 (line 417) | def _test_freeze_thaw_utf8(self, fmt):
    method test_freeze_thaw (line 436) | def test_freeze_thaw(self):
    method test_freeze_thaw_datatypes_json (line 469) | def test_freeze_thaw_datatypes_json(self):
    method test_freeze_thaw_datatypes_csv (line 511) | def test_freeze_thaw_datatypes_csv(self):
    method test_table_column_creation (line 550) | def test_table_column_creation(self):
    method test_table_column_creation_field_col (line 556) | def test_table_column_creation_field_col(self):
    method test_import_json (line 568) | def test_import_json(self):
    method test_import_csv (line 617) | def test_import_csv(self):
    method test_table_thaw (line 665) | def test_table_thaw(self):
    method test_creating_tables (line 674) | def test_creating_tables(self):

FILE: tests/db_tests.py
  class TestDatabase (line 32) | class TestDatabase(DatabaseTestCase):
    method test_pragmas (line 35) | def test_pragmas(self):
    method test_appid_user_version (line 46) | def test_appid_user_version(self):
    method test_timeout_semantics (line 58) | def test_timeout_semantics(self):
    method test_pragmas_deferred (line 72) | def test_pragmas_deferred(self):
    method test_pragmas_as_dict (line 96) | def test_pragmas_as_dict(self):
    method test_pragmas_permanent (line 113) | def test_pragmas_permanent(self):
    method test_context_settings (line 125) | def test_context_settings(self):
    method test_connection_state (line 154) | def test_connection_state(self):
    method test_db_context_manager (line 162) | def test_db_context_manager(self):
    method test_connection_initialization (line 180) | def test_connection_initialization(self):
    method test_connect_semantics (line 195) | def test_connect_semantics(self):
    method test_execute_sql (line 218) | def test_execute_sql(self):
    method test_bind_helpers (line 227) | def test_bind_helpers(self):
    method test_bind_regression (line 256) | def test_bind_regression(self):
    method test_batch_commit (line 289) | def test_batch_commit(self):
    method test_server_version (line 319) | def test_server_version(self):
    method test_explicit_connect (line 341) | def test_explicit_connect(self):
  class TestThreadSafety (line 349) | class TestThreadSafety(ModelTestCase):
    method test_multiple_writers (line 358) | def test_multiple_writers(self):
    method test_multiple_readers (line 372) | def test_multiple_readers(self):
    method test_mt_general (line 387) | def test_mt_general(self):
  class TestDeferredDatabase (line 403) | class TestDeferredDatabase(BaseTestCase):
    method test_deferred_database (line 404) | def test_deferred_database(self):
  class CatToy (line 431) | class CatToy(TestModel):
    class Meta (line 434) | class Meta:
  class TestSchemaNamespace (line 439) | class TestSchemaNamespace(ModelTestCase):
    method setUp (line 442) | def setUp(self):
    method tearDown (line 447) | def tearDown(self):
    method test_schema (line 452) | def test_schema(self):
  class TestSqliteIsolation (line 459) | class TestSqliteIsolation(ModelTestCase):
    method test_sqlite_isolation (line 463) | def test_sqlite_isolation(self):
  class UniqueModel (line 493) | class UniqueModel(TestModel):
  class IndexedModel (line 497) | class IndexedModel(TestModel):
    class Meta (line 502) | class Meta:
  class Note (line 509) | class Note(TestModel):
    class Meta (line 514) | class Meta:
  class Person (line 518) | class Person(TestModel):
    class Meta (line 522) | class Meta:
  class TestIntrospection (line 528) | class TestIntrospection(ModelTestCase):
    method test_table_exists (line 531) | def test_table_exists(self):
    method test_get_tables (line 539) | def test_get_tables(self):
    method test_get_indexes (line 548) | def test_get_indexes(self):
    method test_get_columns (line 575) | def test_get_columns(self):
    method test_get_primary_keys (line 592) | def test_get_primary_keys(self):
    method test_get_views (line 600) | def test_get_views(self):
    method test_get_foreign_keys (line 668) | def test_get_foreign_keys(self):
  class TestSortModels (line 682) | class TestSortModels(BaseTestCase):
    method test_sort_models (line 683) | def test_sort_models(self):
    method test_sort_models_multi_fk (line 700) | def test_sort_models_multi_fk(self):
  class TestDBProxy (line 730) | class TestDBProxy(BaseTestCase):
    method test_proxy_context_manager (line 731) | def test_proxy_context_manager(self):
    method test_db_proxy (line 748) | def test_db_proxy(self):
    method test_proxy_decorator (line 774) | def test_proxy_decorator(self):
    method test_proxy_bind_ctx_callbacks (line 797) | def test_proxy_bind_ctx_callbacks(self):
  class Data (line 824) | class Data(TestModel):
    class Meta (line 828) | class Meta:
  class TestAttachDatabase (line 832) | class TestAttachDatabase(ModelTestCase):
    method test_attach (line 836) | def test_attach(self):
    method test_attach_detach (line 898) | def test_attach_detach(self):
    method test_sqlite_schema_support (line 916) | def test_sqlite_schema_support(self):
  class TestDatabaseConnection (line 932) | class TestDatabaseConnection(DatabaseTestCase):
    method test_is_connection_usable (line 933) | def test_is_connection_usable(self):
    method test_is_connection_usable_pg (line 944) | def test_is_connection_usable_pg(self):
  class TestExceptionWrapper (line 963) | class TestExceptionWrapper(ModelTestCase):
    method test_exception_wrapper (line 967) | def test_exception_wrapper(self):
  class TestModelPropertyHelper (line 978) | class TestModelPropertyHelper(BaseTestCase):
    method test_model_property (line 979) | def test_model_property(self):
    method test_model_property_on_proxy (line 987) | def test_model_property_on_proxy(self):
  class TestChunkedUtility (line 999) | class TestChunkedUtility(BaseTestCase):
    method test_chunked_exact_divisor (line 1000) | def test_chunked_exact_divisor(self):
    method test_chunked_with_remainder (line 1004) | def test_chunked_with_remainder(self):
    method test_chunked_single_element (line 1008) | def test_chunked_single_element(self):
    method test_chunked_empty (line 1012) | def test_chunked_empty(self):
    method test_chunked_size_one (line 1016) | def test_chunked_size_one(self):
    method test_chunked_generator_input (line 1020) | def test_chunked_generator_input(self):

FILE: tests/db_url.py
  class TestDBUrl (line 8) | class TestDBUrl(BaseTestCase):
    method test_db_url_parse (line 9) | def test_db_url_parse(self):
    method test_db_url_no_unquoting (line 32) | def test_db_url_no_unquoting(self):
    method test_db_url_quoted_password (line 41) | def test_db_url_quoted_password(self):
    method test_db_url_quoted_user (line 49) | def test_db_url_quoted_user(self):
    method test_db_url (line 57) | def test_db_url(self):
    method test_bad_scheme (line 83) | def test_bad_scheme(self):

FILE: tests/expressions.py
  class Person (line 10) | class Person(TestModel):
  class BaseNamesTest (line 14) | class BaseNamesTest(ModelTestCase):
    method assertNames (line 17) | def assertNames(self, exp, x):
  class TestRegexp (line 23) | class TestRegexp(BaseNamesTest):
    method test_regexp_iregexp (line 25) | def test_regexp_iregexp(self):
  class TestContains (line 34) | class TestContains(BaseNamesTest):
    method test_contains_startswith_endswith (line 35) | def test_contains_startswith_endswith(self):
  class UpperField (line 48) | class UpperField(TextField):
    method db_value (line 49) | def db_value(self, value):
  class UpperModel (line 53) | class UpperModel(TestModel):
  class TestValueConversion (line 57) | class TestValueConversion(ModelTestCase):
    method test_value_conversion (line 68) | def test_value_conversion(self):
    method test_value_conversion_mixed (line 103) | def test_value_conversion_mixed(self):
    method test_value_conversion_query (line 141) | def test_value_conversion_query(self):
    method test_having_clause (line 167) | def test_having_clause(self):

FILE: tests/extra_fields.py
  class Comp (line 10) | class Comp(TestModel):
  class Pickled (line 15) | class Pickled(TestModel):
  class TestCompressedField (line 20) | class TestCompressedField(ModelTestCase):
    method test_compressed_field (line 23) | def test_compressed_field(self):
  class TestPickleField (line 44) | class TestPickleField(ModelTestCase):
    method test_pickle_field (line 47) | def test_pickle_field(self):

FILE: tests/fields.py
  class IntModel (line 31) | class IntModel(TestModel):
  class TestCoerce (line 36) | class TestCoerce(ModelTestCase):
    method test_coerce (line 39) | def test_coerce(self):
  class DefaultValues (line 46) | class DefaultValues(TestModel):
  class TestTextField (line 51) | class TestTextField(TextField):
    method first_char (line 52) | def first_char(self):
  class PhoneBook (line 56) | class PhoneBook(TestModel):
  class Bits (line 60) | class Bits(TestModel):
  class TestDefaultValues (line 73) | class TestDefaultValues(ModelTestCase):
    method test_default_values (line 76) | def test_default_values(self):
    method test_defaults_create (line 86) | def test_defaults_create(self):
  class TestNullConstraint (line 96) | class TestNullConstraint(ModelTestCase):
    method test_null (line 99) | def test_null(self):
    method test_empty_value (line 104) | def test_empty_value(self):
  class TestIntegerField (line 110) | class TestIntegerField(ModelTestCase):
    method test_integer_field (line 113) | def test_integer_field(self):
  class FloatModel (line 124) | class FloatModel(TestModel):
  class TestFloatField (line 129) | class TestFloatField(ModelTestCase):
    method test_float_field (line 132) | def test_float_field(self):
  class DecimalModel (line 141) | class DecimalModel(TestModel):
  class TestDecimalField (line 147) | class TestDecimalField(ModelTestCase):
    method test_decimal_field (line 150) | def test_decimal_field(self):
    method test_decimal_rounding (line 157) | def test_decimal_rounding(self):
  class BoolModel (line 164) | class BoolModel(TestModel):
  class TestBooleanField (line 169) | class TestBooleanField(ModelTestCase):
    method test_boolean_field (line 172) | def test_boolean_field(self):
  class DateModel (line 184) | class DateModel(TestModel):
  class CustomDateTimeModel (line 190) | class CustomDateTimeModel(TestModel):
  class TestDateFields (line 196) | class TestDateFields(ModelTestCase):
    method test_date_time_custom_format (line 200) | def test_date_time_custom_format(self):
    method test_date_fields (line 206) | def test_date_fields(self):
    method test_extract_parts (line 230) | def test_extract_parts(self):
    method test_truncate_date (line 256) | def test_truncate_date(self):
    method test_to_timestamp (line 285) | def test_to_timestamp(self):
    method test_distinct_date_part (line 312) | def test_distinct_date_part(self):
  class U2 (line 325) | class U2(TestModel):
  class T2 (line 329) | class T2(TestModel):
  class TestForeignKeyField (line 334) | class TestForeignKeyField(ModelTestCase):
    method test_set_fk (line 337) | def test_set_fk(self):
    method test_follow_attributes (line 356) | def test_follow_attributes(self):
    method test_disable_backref (line 372) | def test_disable_backref(self):
    method test_on_delete_behavior (line 387) | def test_on_delete_behavior(self):
  class M1 (line 411) | class M1(TestModel):
  class M2 (line 416) | class M2(TestModel):
  class TestDeferredForeignKey (line 424) | class TestDeferredForeignKey(ModelTestCase):
    method test_deferred_foreign_key (line 427) | def test_deferred_foreign_key(self):
  class TestDeferredForeignKeyResolution (line 439) | class TestDeferredForeignKeyResolution(ModelTestCase):
    method test_unresolved_deferred_fk (line 440) | def test_unresolved_deferred_fk(self):
    method test_deferred_foreign_key_resolution (line 448) | def test_deferred_foreign_key_resolution(self):
  class Composite (line 501) | class Composite(TestModel):
    class Meta (line 506) | class Meta:
  class TestCompositePrimaryKeyField (line 510) | class TestCompositePrimaryKeyField(ModelTestCase):
    method test_composite_primary_key (line 513) | def test_composite_primary_key(self):
  class TestFieldFunction (line 517) | class TestFieldFunction(ModelTestCase):
    method setUp (line 520) | def setUp(self):
    method _test_field_function (line 526) | def _test_field_function(self, PB):
    method test_field_function (line 539) | def test_field_function(self):
    method test_field_function_alias (line 542) | def test_field_function_alias(self):
  class IPModel (line 546) | class IPModel(TestModel):
  class TestIPField (line 551) | class TestIPField(ModelTestCase):
    method test_ip_field (line 554) | def test_ip_field(self):
  class TestBitFields (line 563) | class TestBitFields(ModelTestCase):
    method test_bit_field_update (line 566) | def test_bit_field_update(self):
    method test_bit_field_auto_flag (line 597) | def test_bit_field_auto_flag(self):
    method test_bit_field_instance_flags (line 618) | def test_bit_field_instance_flags(self):
    method test_bit_field (line 638) | def test_bit_field(self):
    method test_bigbit_field_instance_data (line 663) | def test_bigbit_field_instance_data(self):
    method test_bigbit_zero_idx (line 680) | def test_bigbit_zero_idx(self):
    method test_bigbit_item_methods (line 691) | def test_bigbit_item_methods(self):
    method test_bigbit_set_clear (line 707) | def test_bigbit_set_clear(self):
    method test_bigbit_field (line 716) | def test_bigbit_field(self):
    method test_bigbit_field_bitwise (line 730) | def test_bigbit_field_bitwise(self):
    method test_bigbit_field_bulk_create (line 760) | def test_bigbit_field_bulk_create(self):
    method test_bigbit_field_bulk_update (line 771) | def test_bigbit_field_bulk_update(self):
  class BlobModel (line 785) | class BlobModel(TestModel):
  class TestBlobField (line 789) | class TestBlobField(ModelTestCase):
    method test_blob_field (line 792) | def test_blob_field(self):
    method test_blob_on_proxy (line 804) | def test_blob_on_proxy(self):
    method test_blob_db_hook (line 815) | def test_blob_db_hook(self):
  class BigModel (line 841) | class BigModel(TestModel):
  class TestBigAutoField (line 846) | class TestBigAutoField(ModelTestCase):
    method test_big_auto_field (line 849) | def test_big_auto_field(self):
  class Item (line 861) | class Item(TestModel):
  class Bare (line 866) | class Bare(TestModel):
  class TestFieldValueHandling (line 871) | class TestFieldValueHandling(ModelTestCase):
    method test_int_float_multi (line 875) | def test_int_float_multi(self):
    method test_explicit_cast (line 919) | def test_explicit_cast(self):
    method test_bare_model_adapt (line 946) | def test_bare_model_adapt(self):
  class UUIDModel (line 964) | class UUIDModel(TestModel):
  class TestUUIDField (line 969) | class TestUUIDField(ModelTestCase):
    method test_uuid_field (line 972) | def test_uuid_field(self):
    method test_binary_uuid_field (line 997) | def test_binary_uuid_field(self):
  class UU1 (line 1023) | class UU1(TestModel):
  class UU2 (line 1027) | class UU2(TestModel):
  class TestForeignKeyUUIDField (line 1033) | class TestForeignKeyUUIDField(ModelTestCase):
    method test_bulk_insert (line 1036) | def test_bulk_insert(self):
  class TSModel (line 1058) | class TSModel(TestModel):
  class TSR (line 1065) | class TSR(TestModel):
  class TestTimestampField (line 1072) | class TestTimestampField(ModelTestCase):
    method test_timestamp_field_resolutions (line 1076) | def test_timestamp_field_resolutions(self):
    method test_timestamp_field (line 1087) | def test_timestamp_field(self):
    method test_timestamp_field_math (line 1102) | def test_timestamp_field_math(self):
    method test_timestamp_field_value_as_ts (line 1120) | def test_timestamp_field_value_as_ts(self):
    method test_timestamp_utc_vs_localtime (line 1141) | def test_timestamp_utc_vs_localtime(self):
    method test_timestamp_field_parts (line 1164) | def test_timestamp_field_parts(self):
    method test_timestamp_field_from_ts (line 1194) | def test_timestamp_field_from_ts(self):
    method test_invalid_resolution (line 1221) | def test_invalid_resolution(self):
  class ListField (line 1227) | class ListField(TextField):
    method db_value (line 1228) | def db_value(self, value):
    method python_value (line 1231) | def python_value(self, value):
  class Todo (line 1235) | class Todo(TestModel):
  class TestCustomField (line 1240) | class TestCustomField(ModelTestCase):
    method test_custom_field (line 1243) | def test_custom_field(self):
  class UpperField (line 1260) | class UpperField(TextField):
    method db_value (line 1261) | def db_value(self, value):
  class UpperModel (line 1265) | class UpperModel(TestModel):
  class TestSQLFunctionDBValue (line 1269) | class TestSQLFunctionDBValue(ModelTestCase):
    method test_sql_function_db_value (line 1273) | def test_sql_function_db_value(self):
  class Schedule (line 1296) | class Schedule(TestModel):
  class Task (line 1299) | class Task(TestModel):
  class TestDateTimeMath (line 1305) | class TestDateTimeMath(ModelTestCase):
    method setUp (line 1315) | def setUp(self):
    method _do_test_date_time_math (line 1326) | def _do_test_date_time_math(self, next_occurrence_expression):
    method test_date_time_math_pg (line 1338) | def test_date_time_math_pg(self):
    method test_date_time_math_sqlite (line 1344) | def test_date_time_math_sqlite(self):
    method test_date_time_math_mysql (line 1352) | def test_date_time_math_mysql(self):
  class NQ (line 1358) | class NQ(TestModel):
  class NQItem (line 1361) | class NQItem(TestModel):
  class TestForeignKeyLazyLoad (line 1369) | class TestForeignKeyLazyLoad(ModelTestCase):
    method setUp (line 1372) | def setUp(self):
    method test_doesnotexist_lazy_load (line 1381) | def test_doesnotexist_lazy_load(self):
    method test_foreign_key_lazy_load (line 1394) | def test_foreign_key_lazy_load(self):
    method test_fk_lazy_load_related_instance (line 1420) | def test_fk_lazy_load_related_instance(self):
    method test_fk_lazy_select_related (line 1431) | def test_fk_lazy_select_related(self):
  class SM (line 1456) | class SM(TestModel):
  class TestStringFields (line 1461) | class TestStringFields(ModelTestCase):
    method test_string_fields (line 1464) | def test_string_fields(self):
  class InvalidTypes (line 1492) | class InvalidTypes(TestModel):
  class TestSqliteInvalidDataTypes (line 1498) | class TestSqliteInvalidDataTypes(ModelTestCase):
    method test_invalid_data_types (line 1502) | def test_invalid_data_types(self):
  class DblSI (line 1514) | class DblSI(TestModel):
  class TestDoubleSmallInt (line 1519) | class TestDoubleSmallInt(ModelTestCase):
    method test_double_round_trip (line 1523) | def test_double_round_trip(self):
    method test_small_int_round_trip (line 1528) | def test_small_int_round_trip(self):
    method test_coercion (line 1537) | def test_coercion(self):
  class FC (line 1549) | class FC(TestModel):
  class TestFixedCharFieldIntegration (line 1554) | class TestFixedCharFieldIntegration(ModelTestCase):
    method test_fixed_char_truncates (line 1558) | def test_fixed_char_truncates(self):
  class VF (line 1565) | class VF(TestModel):
  class TestVirtualFieldBehavior (line 1570) | class TestVirtualFieldBehavior(BaseTestCase):
    method test_virtual_field_not_in_columns (line 1571) | def test_virtual_field_not_in_columns(self):
    method test_virtual_field_db_value (line 1583) | def test_virtual_field_db_value(self):

FILE: tests/hybrid.py
  class Interval (line 10) | class Interval(TestModel):
    method length (line 15) | def length(self):
    method contains (line 19) | def contains(self, point):
    method radius (line 23) | def radius(self):
    method radius (line 27) | def radius(cls):
  class Person (line 31) | class Person(TestModel):
    method full_name (line 36) | def full_name(self):
  class SubPerson (line 39) | class SubPerson(Person):
  class TestHybridProperties (line 43) | class TestHybridProperties(ModelTestCase):
    method setUp (line 47) | def setUp(self):
    method test_hybrid_property (line 57) | def test_hybrid_property(self):
    method test_hybrid_method (line 70) | def test_hybrid_method(self):
    method test_expression (line 83) | def test_expression(self):
    method test_string_fields (line 96) | def test_string_fields(self):
    method test_hybrid_model_alias (line 107) | def test_hybrid_model_alias(self):
    method test_hybrid_subclass_model_alias (line 117) | def test_hybrid_subclass_model_alias(self):
  class Order (line 127) | class Order(TestModel):
    method quantity (line 131) | def quantity(self):
    method quantity (line 135) | def quantity(cls):
  class Item (line 138) | class Item(TestModel):
  class TestHybridWithRelationship (line 143) | class TestHybridWithRelationship(ModelTestCase):
    method test_hybrid_with_relationship (line 147) | def test_hybrid_with_relationship(self):

FILE: tests/keys.py
  class Package (line 12) | class Package(TestModel):
  class PackageItem (line 16) | class PackageItem(TestModel):
  class Manufacturer (line 21) | class Manufacturer(TestModel):
  class Component (line 25) | class Component(TestModel):
  class Computer (line 30) | class Computer(TestModel):
  class User (line 36) | class User(TestModel):
    class Meta (line 39) | class Meta:
  class Relationship (line 43) | class Relationship(TestModel):
  class Note (line 48) | class Note(TestModel):
  class CompositeKeyModel (line 53) | class CompositeKeyModel(TestModel):
    class Meta (line 58) | class Meta:
  class UserThing (line 62) | class UserThing(TestModel):
    class Meta (line 66) | class Meta:
  class Post (line 70) | class Post(TestModel):
  class Tag (line 74) | class Tag(TestModel):
  class TagPostThrough (line 78) | class TagPostThrough(TestModel):
    class Meta (line 82) | class Meta:
  class TagPostThroughAlt (line 86) | class TagPostThroughAlt(TestModel):
  class TestForeignKeyToNonPrimaryKey (line 91) | class TestForeignKeyToNonPrimaryKey(ModelTestCase):
    method setUp (line 94) | def setUp(self):
    method test_fk_resolution (line 104) | def test_fk_resolution(self):
    method test_select_generation (line 109) | def test_select_generation(self):
  class TestMultipleForeignKey (line 116) | class TestMultipleForeignKey(ModelTestCase):
    method setUp (line 123) | def setUp(self):
    method test_multi_join (line 138) | def test_multi_join(self):
  class TestMultipleForeignKeysJoining (line 198) | class TestMultipleForeignKeysJoining(ModelTestCase):
    method test_multiple_fks (line 201) | def test_multiple_fks(self):
  class TestCompositePrimaryKey (line 248) | class TestCompositePrimaryKey(ModelTestCase):
    method setUp (line 251) | def setUp(self):
    method test_create_table_query (line 261) | def test_create_table_query(self):
    method test_get_set_id (line 273) | def test_get_set_id(self):
    method test_querying (line 299) | def test_querying(self):
    method test_composite_key_model (line 314) | def test_composite_key_model(self):
    method test_count_composite_key (line 349) | def test_count_composite_key(self):
    method test_delete_instance (line 367) | def test_delete_instance(self):
    method test_composite_key_inheritance (line 380) | def test_composite_key_inheritance(self):
  class TestForeignKeyConstraints (line 406) | class TestForeignKeyConstraints(ModelTestCase):
    method setUp (line 409) | def setUp(self):
    method tearDown (line 413) | def tearDown(self):
    method set_foreign_key_pragma (line 417) | def set_foreign_key_pragma(self, is_enabled):
    method test_constraint_exists (line 421) | def test_constraint_exists(self):
    method test_disable_constraint (line 428) | def test_disable_constraint(self):
  class FK_A (line 433) | class FK_A(TestModel):
  class FK_B (line 436) | class FK_B(TestModel):
  class TestFKtoNonPKField (line 440) | class TestFKtoNonPKField(ModelTestCase):
    method test_fk_to_non_pk_field (line 443) | def test_fk_to_non_pk_field(self):
    method test_fk_to_non_pk_insert_update (line 458) | def test_fk_to_non_pk_insert_update(self):
  class TestDeferredForeignKeyIntegration (line 485) | class TestDeferredForeignKeyIntegration(ModelTestCase):
    method test_deferred_fk_simple (line 488) | def test_deferred_fk_simple(self):
    method test_deferred_fk_as_pk (line 511) | def test_deferred_fk_as_pk(self):

FILE: tests/kv.py
  class TestKeyValue (line 8) | class TestKeyValue(DatabaseTestCase):
    method setUp (line 9) | def setUp(self):
    method tearDown (line 13) | def tearDown(self):
    method create_kv (line 18) | def create_kv(self, **kwargs):
    method test_basic_apis (line 23) | def test_basic_apis(self):
    method test_update (line 66) | def test_update(self):
    method test_expressions (line 92) | def test_expressions(self):
    method test_integer_keys (line 117) | def test_integer_keys(self):

FILE: tests/manytomany.py
  class User (line 11) | class User(TestModel):
  class Note (line 14) | class Note(TestModel):
  class AltNote (line 22) | class AltNote(TestModel):
  class AltThroughModel (line 26) | class AltThroughModel(TestModel):
    class Meta (line 30) | class Meta:
  class Student (line 35) | class Student(TestModel):
  class Course (line 40) | class Course(TestModel):
  class CourseStudent2 (line 47) | class CourseStudent2(TestModel):
  class Color (line 54) | class Color(TestModel):
  class Logo (line 59) | class Logo(TestModel):
  class LogoColor (line 63) | class LogoColor(TestModel):
  class TestManyToManyFKtoNonPK (line 70) | class TestManyToManyFKtoNonPK(ModelTestCase):
    method test_manytomany_fk_to_non_pk (line 74) | def test_manytomany_fk_to_non_pk(self):
  class TestManyToManyBackrefBehavior (line 140) | class TestManyToManyBackrefBehavior(ModelTestCase):
    method setUp (line 144) | def setUp(self):
    method test_manytomanyfield_disabled_backref (line 156) | def test_manytomanyfield_disabled_backref(self):
    method test_through_model_disabled_backrefs (line 168) | def test_through_model_disabled_backrefs(self):
  class TestManyToManyInheritance (line 184) | class TestManyToManyInheritance(ModelTestCase):
    method test_manytomany_inheritance (line 185) | def test_manytomany_inheritance(self):
  class TestManyToMany (line 209) | class TestManyToMany(ModelTestCase):
    method setUp (line 220) | def setUp(self):
    method test_through_model (line 227) | def test_through_model(self):
    method _set_data (line 240) | def _set_data(self):
    method assertNotes (line 248) | def assertNotes(self, query, expected):
    method assertUsers (line 253) | def assertUsers(self, query, expected):
    method test_accessor_query (line 257) | def test_accessor_query(self):
    method test_prefetch_notes (line 278) | def test_prefetch_notes(self):
    method test_prefetch_users (line 295) | def test_prefetch_users(self):
    method test_query_filtering (line 314) | def test_query_filtering(self):
    method test_set_value (line 322) | def test_set_value(self):
    method test_set_query (line 339) | def test_set_query(self):
    method test_add (line 346) | def test_add(self):
    method test_add_by_pk (line 379) | def test_add_by_pk(self):
    method test_unique (line 388) | def test_unique(self):
    method test_remove (line 402) | def test_remove(self):
    method test_remove_by_id (line 429) | def test_remove_by_id(self):
    method test_clear (line 441) | def test_clear(self):
    method test_manual_through (line 468) | def test_manual_through(self):
  class Person (line 546) | class Person(TestModel):
  class Account (line 549) | class Account(TestModel):
  class AccountList (line 552) | class AccountList(TestModel):
  class TestForeignKeyPrimaryKeyManyToMany (line 559) | class TestForeignKeyPrimaryKeyManyToMany(ModelTestCase):
    method setUp (line 569) | def setUp(self):
    method account_for (line 581) | def account_for(self, name):
    method assertLists (line 584) | def assertLists(self, l1, l2):
    method test_pk_is_fk (line 587) | def test_pk_is_fk(self):
    method test_empty (line 602) | def test_empty(self):
  class Permission (line 607) | class Permission(TestModel):
  class Visitor (line 612) | class Visitor(TestModel):
  class DeniedThrough (line 617) | class DeniedThrough(TestModel):
  class TestMultipleManyToManySameTables (line 624) | class TestMultipleManyToManySameTables(ModelTestCase):
    method test_multiple_manytomany_same_tables (line 629) | def test_multiple_manytomany_same_tables(self):

FILE: tests/migrations.py
  class Tag (line 33) | class Tag(TestModel):
  class Person (line 36) | class Person(TestModel):
  class User (line 41) | class User(TestModel):
    class Meta (line 45) | class Meta:
  class Page (line 48) | class Page(TestModel):
  class Session (line 52) | class Session(TestModel):
  class IndexModel (line 56) | class IndexModel(TestModel):
    class Meta (line 61) | class Meta:
  class Category (line 66) | class Category(TestModel):
  class TestSchemaMigration (line 70) | class TestSchemaMigration(ModelTestCase):
    method setUp (line 82) | def setUp(self):
    method tearDown (line 86) | def tearDown(self):
    method test_add_table_constraint (line 93) | def test_add_table_constraint(self):
    method test_add_unique (line 113) | def test_add_unique(self):
    method test_drop_table_constraint (line 131) | def test_drop_table_constraint(self):
    method test_add_column (line 153) | def test_add_column(self):
    method test_add_column_constraint (line 208) | def test_add_column_constraint(self):
    method _create_people (line 237) | def _create_people(self):
    method get_column_names (line 241) | def get_column_names(self, tbl):
    method test_drop_column (line 245) | def test_drop_column(self, legacy=False):
    method test_drop_column_sqlite_legacy (line 267) | def test_drop_column_sqlite_legacy(self):
    method test_rename_column (line 270) | def test_rename_column(self, legacy=False):
    method test_rename_column_sqlite_legacy (line 298) | def test_rename_column_sqlite_legacy(self):
    method test_rename_gh380 (line 301) | def test_rename_gh380(self, legacy=False):
    method test_rename_gh380_sqlite_legacy (line 332) | def test_rename_gh380_sqlite_legacy(self):
    method test_add_default_drop_default (line 336) | def test_add_default_drop_default(self):
    method test_add_not_null (line 359) | def test_add_not_null(self):
    method test_drop_not_null (line 388) | def test_drop_not_null(self):
    method test_modify_not_null_foreign_key (line 402) | def test_modify_not_null_foreign_key(self):
    method test_rename_table (line 435) | def test_rename_table(self):
    method test_add_index (line 465) | def test_add_index(self):
    method test_add_unique_column (line 475) | def test_add_unique_column(self):
    method test_drop_index (line 496) | def test_drop_index(self):
    method test_add_and_remove (line 512) | def test_add_and_remove(self):
    method test_multiple_operations (line 523) | def test_multiple_operations(self):
    method test_add_foreign_key (line 575) | def test_add_foreign_key(self):
    method test_drop_foreign_key (line 608) | def test_drop_foreign_key(self):
    method test_rename_foreign_key (line 617) | def test_rename_foreign_key(self):
    method test_rename_unique_foreign_key (line 631) | def test_rename_unique_foreign_key(self):
    method test_add_column_with_index_type (line 647) | def test_add_column_with_index_type(self):
    method test_alter_column_type (line 660) | def test_alter_column_type(self):
    method test_valid_column_required (line 692) | def test_valid_column_required(self):
    method test_table_case_insensitive (line 705) | def test_table_case_insensitive(self):
    method test_add_column_indexed_table (line 723) | def test_add_column_indexed_table(self):
    method test_rename_column_to_table_name (line 741) | def test_rename_column_to_table_name(self):
    method test_add_fk_with_constraints (line 767) | def test_add_fk_with_constraints(self):
    method test_index_preservation (line 785) | def test_index_preservation(self):
    method test_modify_fk_constraint (line 843) | def test_modify_fk_constraint(self):
    method test_make_index_name (line 896) | def test_make_index_name(self):
    method test_make_index_name_long (line 899) | def test_make_index_name_long(self):
  class BadNames (line 910) | class BadNames(TestModel):
    class Meta (line 915) | class Meta:
  class HasChecks (line 921) | class HasChecks(TestModel):
    class Meta (line 924) | class Meta:
  class TestSqliteColumnNameRegression (line 930) | class TestSqliteColumnNameRegression(ModelTestCase):
    method test_sqlite_check_constraints (line 934) | def test_sqlite_check_constraints(self):
    method test_sqlite_column_name_constraint_regression (line 959) | def test_sqlite_column_name_constraint_regression(self):

FILE: tests/model_save.py
  class T1 (line 8) | class T1(TestModel):
  class T2 (line 12) | class T2(TestModel):
  class T3 (line 16) | class T3(TestModel):
  class T4 (line 20) | class T4(TestModel):
    class Meta (line 24) | class Meta:
  class T5 (line 27) | class T5(TestModel):
  class TestPrimaryKeySaveHandling (line 31) | class TestPrimaryKeySaveHandling(ModelTestCase):
    method test_auto_field (line 34) | def test_auto_field(self):
    method test_server_default_pk (line 68) | def test_server_default_pk(self):
    method test_integer_field_pk (line 92) | def test_integer_field_pk(self):
    method test_composite_pk (line 109) | def test_composite_pk(self):
    method test_returning_object (line 128) | def test_returning_object(self):
  class TestSaveNoData (line 135) | class TestSaveNoData(ModelTestCase):
    method test_save_no_data (line 138) | def test_save_no_data(self):
    method test_save_no_data2 (line 154) | def test_save_no_data2(self):
    method test_save_no_data3 (line 163) | def test_save_no_data3(self):
    method test_save_only_no_data (line 167) | def test_save_only_no_data(self):

FILE: tests/model_sql.py
  class CKM (line 19) | class CKM(TestModel):
    class Meta (line 23) | class Meta:
  class TestModelSQL (line 27) | class TestModelSQL(ModelDatabaseTestCase):
    method test_select (line 31) | def test_select(self):
    method test_reselect (line 47) | def test_reselect(self):
    method test_select_extend (line 65) | def test_select_extend(self):
    method test_selected_columns (line 74) | def test_selected_columns(self):
    method test_where_coerce (line 98) | def test_where_coerce(self):
    method test_group_by (line 114) | def test_group_by(self):
    method test_group_by_extend (line 126) | def test_group_by_extend(self):
    method test_order_by (line 138) | def test_order_by(self):
    method test_order_by_extend (line 146) | def test_order_by_extend(self):
    method test_paginate (line 155) | def test_paginate(self):
    method test_subquery_correction (line 168) | def test_subquery_correction(self):
    method test_value_flattening (line 179) | def test_value_flattening(self):
    method test_model_select_from (line 196) | def test_model_select_from(self):
    method test_join_ctx (line 207) | def test_join_ctx(self):
    method test_model_alias (line 234) | def test_model_alias(self):
    method test_model_alias_with_schema (line 246) | def test_model_alias_with_schema(self):
    method test_model_alias_join_with_schema (line 262) | def test_model_alias_join_with_schema(self):
    method test_filter_simple (line 278) | def test_filter_simple(self):
    method test_filter_expressions (line 302) | def test_filter_expressions(self):
    method test_filter_join (line 313) | def test_filter_join(self):
    method test_filter_with_or_across_joins (line 330) | def test_filter_with_or_across_joins(self):
    method test_filter_join_combine_models (line 343) | def test_filter_join_combine_models(self):
    method test_mix_filter_methods (line 354) | def test_mix_filter_methods(self):
    method test_join_parent (line 369) | def test_join_parent(self):
    method test_cross_join (line 382) | def test_cross_join(self):
    method test_join_expr (lin
Condensed preview — 167 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,979K chars).
[
  {
    "path": ".github/workflows/tests.yaml",
    "chars": 2807,
    "preview": "name: Tests\non: [push]\njobs:\n  tests:\n    name: ${{ matrix.peewee-backend }} - ${{ matrix.python-version }}\n    runs-on:"
  },
  {
    "path": ".github/workflows/wheels.yaml",
    "chars": 975,
    "preview": "name: Build wheels\non:\n push:\n   tags:\n     - \"[0-9]+.[0-9]+.[0-9]+\"\n     - \"[0-9]+.[0-9]+.[0-9]+-**\"\n\njobs:\n  build:\n  "
  },
  {
    "path": ".gitignore",
    "chars": 164,
    "preview": "*.pyc\nbuild\nprof/\ndocs/_build/\nplayhouse/*.c\nplayhouse/*.h\nplayhouse/*.so\nplayhouse/tests/peewee_test.db\n.idea/\nMANIFEST"
  },
  {
    "path": ".readthedocs.yaml",
    "chars": 164,
    "preview": "version: 2\npython:\n  install:\n  - requirements: docs/requirements.txt\n\nbuild:\n  os: ubuntu-22.04\n  tools:\n    python: \"3"
  },
  {
    "path": ".travis.yml",
    "chars": 1862,
    "preview": "language: python\npython:\n  - 2.7\n  - 3.4\n  - 3.5\n  - 3.6\nenv:\n  - PEEWEE_TEST_BACKEND=sqlite\n  - PEEWEE_TEST_BACKEND=pos"
  },
  {
    "path": ".travis_deps.sh",
    "chars": 1033,
    "preview": "#!/bin/bash\n\nsetup_sqlite_deps() {\n  wget https://www.sqlite.org/src/tarball/sqlite.tar.gz\n  tar xzf sqlite.tar.gz\n  cd "
  },
  {
    "path": "CHANGELOG.md",
    "chars": 134544,
    "preview": "# Changelog\n\nTracking changes in peewee between versions.  For a complete view of all the\nreleases, visit GitHub:\n\nhttps"
  },
  {
    "path": "LICENSE",
    "chars": 1058,
    "preview": "Copyright (c) 2010 Charles Leifer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this "
  },
  {
    "path": "MANIFEST.in",
    "chars": 261,
    "preview": "include CHANGELOG.md\ninclude LICENSE\ninclude README.rst\ninclude TODO.rst\ninclude pyproject.toml\ninclude runtests.py\nincl"
  },
  {
    "path": "README.rst",
    "chars": 7237,
    "preview": ".. image:: https://media.charlesleifer.com/blog/photos/peewee4-logo.png\n\npeewee\n======\n\nPeewee is a simple and small ORM"
  },
  {
    "path": "bench.py",
    "chars": 3851,
    "preview": "from peewee import *\n\n\ndb = SqliteDatabase(':memory:')\n#db = PostgresqlDatabase('peewee_test', host='127.0.0.1', port=26"
  },
  {
    "path": "docs/Makefile",
    "chars": 4590,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD "
  },
  {
    "path": "docs/_themes/flask/layout.html",
    "chars": 750,
    "preview": "{%- extends \"basic/layout.html\" %}\n{%- block extrahead %}\n  {{ super() }}\n  {% if theme_touch_icon %}\n  <link rel=\"apple"
  },
  {
    "path": "docs/_themes/flask/relations.html",
    "chars": 590,
    "preview": "<h3>Related Topics</h3>\n<ul>\n  <li><a href=\"{{ pathto(master_doc) }}\">Documentation overview</a><ul>\n  {%- for parent in"
  },
  {
    "path": "docs/_themes/flask/static/flasky.css_t",
    "chars": 6436,
    "preview": "/*\n * flasky.css_t\n * ~~~~~~~~~~~~\n *\n * :copyright: Copyright 2010 by Armin Ronacher.\n * :license: Flask Design License"
  },
  {
    "path": "docs/_themes/flask/static/small_flask.css",
    "chars": 976,
    "preview": "/*\n * small_flask.css_t\n * ~~~~~~~~~~~~~~~~~\n *\n * :copyright: Copyright 2010 by Armin Ronacher.\n * :license: Flask Desi"
  },
  {
    "path": "docs/_themes/flask/theme.conf",
    "chars": 164,
    "preview": "[theme]\ninherit = basic\nstylesheet = flasky.css\npygments_style = flask_theme_support.FlaskyStyle\n\n[options]\nindex_logo ="
  },
  {
    "path": "docs/clubdata.sql",
    "chars": 169937,
    "preview": "--\n-- PostgreSQL database dump\n--\n--CREATE DATABASE exercises;\n--\\c exercises\n--CREATE SCHEMA cd;\n\n\n\n-- Dumped from data"
  },
  {
    "path": "docs/conf.py",
    "chars": 7598,
    "preview": "# -*- coding: utf-8 -*-\n#\n# peewee documentation build configuration file, created by\n# sphinx-quickstart on Fri Nov 26 "
  },
  {
    "path": "docs/index.rst",
    "chars": 2018,
    "preview": ".. peewee documentation master file, created by\n   sphinx-quickstart on Thu Nov 25 21:20:29 2010.\n   You can adapt this "
  },
  {
    "path": "docs/make.bat",
    "chars": 4106,
    "preview": "@ECHO OFF\n\nREM Command file for Sphinx documentation\n\nif \"%SPHINXBUILD%\" == \"\" (\n\tset SPHINXBUILD=sphinx-build\n)\nset BUI"
  },
  {
    "path": "docs/peewee/api.rst",
    "chars": 201477,
    "preview": ".. _api:\n\nAPI Reference\n=============\n\nThis document specifies Peewee's APIs.\n\n.. contents:: On this page\n   :local:\n   "
  },
  {
    "path": "docs/peewee/asyncio.rst",
    "chars": 22020,
    "preview": ".. _pwasyncio:\n\nAsync Support\n=============\n\n.. module:: playhouse.pwasyncio\n\nPeewee's async extension bridges blocking "
  },
  {
    "path": "docs/peewee/contributing.rst",
    "chars": 2042,
    "preview": ".. _contributing:\n\nContributing\n============\n\nIn order to continually improve, Peewee needs the help of developers like "
  },
  {
    "path": "docs/peewee/database.rst",
    "chars": 23518,
    "preview": ".. _database:\n\nDatabase\n========\n\nThe Peewee :class:`Database` object represents a connection to a database.\nThe :class:"
  },
  {
    "path": "docs/peewee/db_tools.rst",
    "chars": 29031,
    "preview": ".. _db-tools:\n\nDatabase Tooling\n================\n\nThis section covers the playhouse modules for managing connections, da"
  },
  {
    "path": "docs/peewee/example.rst",
    "chars": 14937,
    "preview": ".. _example:\n\nExample app\n===========\n\nWe'll be building a simple *twitter*-like site. The source code for the example\nc"
  },
  {
    "path": "docs/peewee/framework_integration.rst",
    "chars": 17767,
    "preview": ".. _framework-integration:\n\nFramework Integration\n=====================\n\nFor web applications, it is common to open a co"
  },
  {
    "path": "docs/peewee/installation.rst",
    "chars": 4139,
    "preview": ".. _installation:\n\nInstalling and Testing\n======================\n\nInstall the latest release from PyPI:\n\n.. code-block::"
  },
  {
    "path": "docs/peewee/interactive.rst",
    "chars": 4227,
    "preview": ".. _interactive:\n\nUsing Peewee Interactively\n==========================\n\nPeewee contains helpers for working interactive"
  },
  {
    "path": "docs/peewee/models.rst",
    "chars": 43790,
    "preview": ".. _models:\n\nModels and Fields\n=================\n\nModels and Fields allow Peewee applications to declare the tables and "
  },
  {
    "path": "docs/peewee/mysql.rst",
    "chars": 2089,
    "preview": ".. _mysql:\n\nMySQL and MariaDB\n=================\n\n.. module:: playhouse.mysql_ext\n\nPeewee provides alternate drivers for "
  },
  {
    "path": "docs/peewee/orm_utils.rst",
    "chars": 45874,
    "preview": ".. _orm-utils:\n\nORM Utilities\n=============\n\nThese modules provide higher-level abstractions on top of Peewee's core ORM"
  },
  {
    "path": "docs/peewee/pool-snippet.rst",
    "chars": 557,
    "preview": "Commonly-used pool implementations:\n\n* :class:`PooledPostgresqlDatabase`\n* :class:`PooledMySQLDatabase`\n* :class:`Pooled"
  },
  {
    "path": "docs/peewee/postgres.rst",
    "chars": 30310,
    "preview": ".. _postgresql:\n\nPostgresql\n==========\n\n.. module:: playhouse.postgres_ext\n\nThe ``playhouse.postgres_ext`` module expose"
  },
  {
    "path": "docs/peewee/query_builder.rst",
    "chars": 12863,
    "preview": ".. _query-builder:\n\nQuery Builder\n=============\n\nPeewee's high-level :class:`Model` and :class:`Field` APIs are built up"
  },
  {
    "path": "docs/peewee/query_library.rst",
    "chars": 59219,
    "preview": ".. _query-library:\n\nQuery Examples Library\n======================\n\nThese query examples are taken from the site `Postgre"
  },
  {
    "path": "docs/peewee/query_operators.rst",
    "chars": 16143,
    "preview": ".. _query-operators:\n\nQuery Operators\n===============\n\nThe following types of comparisons are supported by peewee:\n\n===="
  },
  {
    "path": "docs/peewee/querying.rst",
    "chars": 36611,
    "preview": ".. _querying:\n\nQuerying\n========\n\nThis document covers reading data from the database: SELECT queries, filtering,\nsortin"
  },
  {
    "path": "docs/peewee/quickstart.rst",
    "chars": 5547,
    "preview": ".. _quickstart:\n\nQuickstart\n==========\n\nThis guide walks through defining a schema, writing rows, and reading them\nback."
  },
  {
    "path": "docs/peewee/recipes.rst",
    "chars": 15845,
    "preview": ".. _recipes:\n\nRecipes\n=======\n\nCollected patterns for common real-world problems. Each recipe assumes\nfamiliarity with :"
  },
  {
    "path": "docs/peewee/relationships.rst",
    "chars": 31878,
    "preview": ".. _relationships:\n\nRelationships and Joins\n=======================\n\nRelational databases derive most of their power fro"
  },
  {
    "path": "docs/peewee/schema.rst",
    "chars": 6477,
    "preview": ".. _schema:\n\nSchema Management\n=================\n\nThis document covers creating and dropping tables, managing indexes an"
  },
  {
    "path": "docs/peewee/sqlite.rst",
    "chars": 84642,
    "preview": ".. _sqlite:\n\nSQLite\n======\n\nThe core :class:`SqliteDatabase` handles pragmas, user-defined functions,\nWAL mode, full-tex"
  },
  {
    "path": "docs/peewee/transactions.rst",
    "chars": 8887,
    "preview": ".. _transactions:\n\nTransactions\n============\n\nA *transaction* groups one or more SQL statements into a single unit of wo"
  },
  {
    "path": "docs/peewee/writing.rst",
    "chars": 21971,
    "preview": ".. _writing:\n\nWriting Data\n============\n\nThis document covers INSERT, UPDATE, and DELETE queries. Reading data is\ncovere"
  },
  {
    "path": "docs/requirements.txt",
    "chars": 31,
    "preview": "docutils<0.18\nsphinx-rtd-theme\n"
  },
  {
    "path": "examples/adjacency_list.py",
    "chars": 1489,
    "preview": "from peewee import *\n\n\ndb = SqliteDatabase(':memory:')\n\nclass Node(Model):\n    name = TextField()\n    parent = ForeignKe"
  },
  {
    "path": "examples/analytics/app.py",
    "chars": 4355,
    "preview": "\"\"\"\nExample \"Analytics\" app. To start using this on your site, do the following:\n\n* Create a postgresql database:\n\n    c"
  },
  {
    "path": "examples/analytics/reports.py",
    "chars": 4400,
    "preview": "from peewee import *\n\nfrom app import Account, PageView\n\n\nDEFAULT_ACCOUNT_ID = 1\n\nclass Report(object):\n    def __init__"
  },
  {
    "path": "examples/analytics/requirements.txt",
    "chars": 22,
    "preview": "peewee\nflask\npsycopg2\n"
  },
  {
    "path": "examples/analytics/run_example.py",
    "chars": 103,
    "preview": "#!/usr/bin/env python\n\nimport sys\nsys.path.insert(0, '../..')\n\nfrom app import app\napp.run(debug=True)\n"
  },
  {
    "path": "examples/anomaly_detection.py",
    "chars": 1697,
    "preview": "import math\nfrom peewee import *\n\n\ndb = SqliteDatabase(':memory:')\n\nclass Reg(Model):\n    key = TextField()\n    value = "
  },
  {
    "path": "examples/blog/app.py",
    "chars": 9632,
    "preview": "import datetime\nimport functools\nimport os\nimport re\nimport urllib\n\nfrom flask import (Flask, flash, redirect, render_te"
  },
  {
    "path": "examples/blog/requirements.txt",
    "chars": 55,
    "preview": "flask\nbeautifulsoup4\nmicawber\npygments\nmarkdown\npeewee\n"
  },
  {
    "path": "examples/blog/static/css/hilite.css",
    "chars": 1713,
    "preview": ".highlight {\n\tbackground: #040400;\n\tcolor: #FFFFFF;\n}\n\n.highlight span.selection { color: #323232; }\n.highlight span.gp "
  },
  {
    "path": "examples/blog/static/robots.txt",
    "chars": 14,
    "preview": "User-agent: *\n"
  },
  {
    "path": "examples/blog/templates/base.html",
    "chars": 2825,
    "preview": "<!doctype html>\n<html>\n  <head>\n    <title>Blog</title>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible"
  },
  {
    "path": "examples/blog/templates/create.html",
    "chars": 1408,
    "preview": "{% extends \"base.html\" %}\n\n{% block title %}Create entry{% endblock %}\n\n{% block content_title %}Create entry{% endblock"
  },
  {
    "path": "examples/blog/templates/detail.html",
    "chars": 429,
    "preview": "{% extends \"base.html\" %}\n\n{% block title %}{{ entry.title }}{% endblock %}\n\n{% block content_title %}{{ entry.title }}{"
  },
  {
    "path": "examples/blog/templates/edit.html",
    "chars": 250,
    "preview": "{% extends \"create.html\" %}\n\n{% block title %}Edit entry{% endblock %}\n\n{% block content_title %}Edit entry{% endblock %"
  },
  {
    "path": "examples/blog/templates/includes/pagination.html",
    "chars": 778,
    "preview": "{% if pagination.get_page_count() > 1 %}\n<ul class=\"pager\">\n  {% if pagination.get_page() > 1 %}\n    <li class=\"previous"
  },
  {
    "path": "examples/blog/templates/index.html",
    "chars": 636,
    "preview": "{% extends \"base.html\" %}\n\n{% block title %}Blog entries{% endblock %}\n\n{% block content_title %}{% if search %}Search \""
  },
  {
    "path": "examples/blog/templates/login.html",
    "chars": 663,
    "preview": "{% extends \"base.html\" %}\n\n{% block title %}Log in{% endblock %}\n\n{% block content_title %}Log in{% endblock %}\n\n{% bloc"
  },
  {
    "path": "examples/blog/templates/logout.html",
    "chars": 363,
    "preview": "{% extends \"base.html\" %}\n\n{% block title %}Log out{% endblock %}\n\n{% block content_title %}Log out{% endblock %}\n\n{% bl"
  },
  {
    "path": "examples/diary.py",
    "chars": 2450,
    "preview": "#!/usr/bin/env python\n\nfrom collections import OrderedDict\nimport datetime\nfrom getpass import getpass\nimport sys\n\nfrom "
  },
  {
    "path": "examples/graph.py",
    "chars": 2131,
    "preview": "from peewee import *\n\n\ndb = SqliteDatabase(':memory:')\n\n\nclass Base(Model):\n    class Meta:\n        database = db\n\n\nclas"
  },
  {
    "path": "examples/hexastore.py",
    "chars": 5022,
    "preview": "try:\n    from functools import reduce\nexcept ImportError:\n    pass\nimport operator\n\nfrom peewee import *\n\n\nclass Hexasto"
  },
  {
    "path": "examples/query_library.py",
    "chars": 1377,
    "preview": "# Collection of Query Examples.\n# https://docs.peewee-orm.com/en/latest/peewee/query_library.html\n\nfrom functools import"
  },
  {
    "path": "examples/reddit_ranking.py",
    "chars": 1413,
    "preview": "import datetime\nimport math\n\nfrom peewee import *\nfrom peewee import query_to_string\n\n\ndb = SqliteDatabase(':memory:')\n\n"
  },
  {
    "path": "examples/sqlite_fts_compression.py",
    "chars": 1730,
    "preview": "#\n# Small example demonstrating the use of zlib compression with the Sqlite\n# full-text search extension.\n#\nimport zlib\n"
  },
  {
    "path": "examples/twitter/app.py",
    "chars": 11451,
    "preview": "import datetime\n\nfrom flask import Flask\nfrom flask import g\nfrom flask import redirect\nfrom flask import request\nfrom f"
  },
  {
    "path": "examples/twitter/requirements.txt",
    "chars": 13,
    "preview": "flask\npeewee\n"
  },
  {
    "path": "examples/twitter/run_example.py",
    "chars": 124,
    "preview": "#!/usr/bin/env python\n\nimport sys\nsys.path.insert(0, '../..')\n\nfrom app import app, create_tables\ncreate_tables()\napp.ru"
  },
  {
    "path": "examples/twitter/static/style.css",
    "chars": 797,
    "preview": "body            { font-family: sans-serif; background: #eee; }\na, h1, h2       { color: #377BA8; }\nh1, h2          { fon"
  },
  {
    "path": "examples/twitter/templates/create.html",
    "chars": 291,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Create</h2>\n  <form action=\"{{ url_for('create') }}\" method=post>\n   "
  },
  {
    "path": "examples/twitter/templates/homepage.html",
    "chars": 106,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Home</h2>\n  <p>Welcome to the site!</p>\n{% endblock %}\n"
  },
  {
    "path": "examples/twitter/templates/includes/message.html",
    "chars": 198,
    "preview": "<a class=\"avatar\" href=\"{{ url_for('user_detail', username=message.user.username) }}\"><img src=\"{{ message.user.gravatar"
  },
  {
    "path": "examples/twitter/templates/includes/pagination.html",
    "chars": 178,
    "preview": "{% if page > 1 %}\n  <a class=\"prev\" href=\"?page={{ page - 1 }}\">Previous</a>\n{% endif %}\n{% if page < pages %}\n  <a clas"
  },
  {
    "path": "examples/twitter/templates/join.html",
    "chars": 487,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Join</h2>\n  <form action=\"{{ url_for('join') }}\" method=\"post\">\n    <"
  },
  {
    "path": "examples/twitter/templates/layout.html",
    "chars": 696,
    "preview": "<!doctype html>\n<title>Tweepee</title>\n<link rel=stylesheet type=text/css href=\"{{ url_for('static', filename='style.css"
  },
  {
    "path": "examples/twitter/templates/login.html",
    "chars": 407,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Login</h2>\n  {% if error %}<p class=error><strong>Error:</strong> {{ "
  },
  {
    "path": "examples/twitter/templates/private_messages.html",
    "chars": 254,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Private Timeline</h2>\n  <ul>\n    {% for message in message_list %}\n  "
  },
  {
    "path": "examples/twitter/templates/public_messages.html",
    "chars": 253,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Public Timeline</h2>\n  <ul>\n    {% for message in message_list %}\n   "
  },
  {
    "path": "examples/twitter/templates/user_detail.html",
    "chars": 780,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Messages from {{ user.username }}</h2>\n  {% if current_user %}\n    {%"
  },
  {
    "path": "examples/twitter/templates/user_followers.html",
    "chars": 305,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Followers</h2>\n  <ul>\n    {% for user in current_user.followers() %}\n"
  },
  {
    "path": "examples/twitter/templates/user_following.html",
    "chars": 305,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Following</h2>\n  <ul>\n    {% for user in current_user.following() %}\n"
  },
  {
    "path": "examples/twitter/templates/user_list.html",
    "chars": 286,
    "preview": "{% extends \"layout.html\" %}\n{% block body %}\n  <h2>Users</h2>\n  <ul>\n    {% for user in user_list %}\n      <li><a href=\""
  },
  {
    "path": "peewee.py",
    "chars": 291363,
    "preview": "from bisect import bisect_left\nfrom bisect import bisect_right\nfrom collections.abc import Callable\nfrom collections.abc"
  },
  {
    "path": "playhouse/README.md",
    "chars": 3383,
    "preview": "## Playhouse\n\nThe `playhouse` namespace contains numerous extensions to Peewee. These include vendor-specific database e"
  },
  {
    "path": "playhouse/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "playhouse/_sqlite_udf.pyx",
    "chars": 11346,
    "preview": "# cython: language_level=3\nfrom libc.stdlib cimport free, malloc\nfrom libc.math cimport log, sqrt\n\nfrom difflib import S"
  },
  {
    "path": "playhouse/apsw_ext.py",
    "chars": 4717,
    "preview": "\"\"\"\nPeewee integration with APSW, \"another python sqlite wrapper\".\n\nProject page: https://rogerbinns.github.io/apsw/\n\nAP"
  },
  {
    "path": "playhouse/cockroachdb.py",
    "chars": 9112,
    "preview": "import functools\nimport re\nimport sys\n\nfrom peewee import *\nfrom peewee import _atomic\nfrom peewee import _manual\nfrom p"
  },
  {
    "path": "playhouse/cysqlite_ext.py",
    "chars": 10076,
    "preview": "import logging\nfrom pathlib import Path\n\nfrom peewee import DecimalField\nfrom peewee import ImproperlyConfigured\nfrom pe"
  },
  {
    "path": "playhouse/dataset.py",
    "chars": 16472,
    "preview": "import base64\nimport csv\nimport datetime\nimport json\nimport operator\nimport uuid\nfrom decimal import Decimal\nfrom functo"
  },
  {
    "path": "playhouse/db_url.py",
    "chars": 5161,
    "preview": "from urllib.parse import parse_qsl, unquote, urlparse\n\nfrom peewee import *\nfrom playhouse.pool import PooledMySQLDataba"
  },
  {
    "path": "playhouse/fields.py",
    "chars": 1526,
    "preview": "import pickle\ntry:\n    import bz2\nexcept ImportError:\n    bz2 = None\ntry:\n    import zlib\nexcept ImportError:\n    zlib ="
  },
  {
    "path": "playhouse/flask_utils.py",
    "chars": 8197,
    "preview": "import math\nimport sys\n\nfrom flask import abort\nfrom flask import render_template\nfrom flask import request\nfrom peewee "
  },
  {
    "path": "playhouse/hybrid.py",
    "chars": 1528,
    "preview": "from peewee import ModelDescriptor\n\n\n# Hybrid methods/attributes, based on similar functionality in SQLAlchemy:\n# http:/"
  },
  {
    "path": "playhouse/kv.py",
    "chars": 5586,
    "preview": "import operator\n\nfrom peewee import *\nfrom peewee import sqlite3\nfrom peewee import Expression\nfrom playhouse.fields imp"
  },
  {
    "path": "playhouse/migrate.py",
    "chars": 33956,
    "preview": "\"\"\"\nLightweight schema migrations.\n\nExample Usage\n-------------\n\nInstantiate a migrator:\n\n    # Postgres example:\n    my"
  },
  {
    "path": "playhouse/mysql_ext.py",
    "chars": 3912,
    "preview": "import json\n\ntry:\n    import mysql.connector as mysql_connector\nexcept ImportError:\n    mysql_connector = None\ntry:\n    "
  },
  {
    "path": "playhouse/pool.py",
    "chars": 9441,
    "preview": "import functools\nimport heapq\nimport logging\nimport threading\nimport time\nfrom collections import namedtuple\n\nfrom peewe"
  },
  {
    "path": "playhouse/postgres_ext.py",
    "chars": 19183,
    "preview": "import json\nimport logging\nimport uuid\n\nfrom peewee import *\nfrom peewee import ColumnBase\nfrom peewee import Expression"
  },
  {
    "path": "playhouse/pwasyncio.py",
    "chars": 26671,
    "preview": "import asyncio\nimport collections\nimport contextvars\nimport json\nimport logging\n\nfrom greenlet import greenlet, getcurre"
  },
  {
    "path": "playhouse/pydantic_utils.py",
    "chars": 3620,
    "preview": "from __future__ import annotations\n\nfrom typing import Any\nfrom typing import Literal\nfrom typing import Optional\nfrom t"
  },
  {
    "path": "playhouse/reflection.py",
    "chars": 31625,
    "preview": "import datetime\nimport decimal\nimport re\nimport uuid\nimport warnings\nfrom collections import OrderedDict\nfrom collection"
  },
  {
    "path": "playhouse/shortcuts.py",
    "chars": 12294,
    "preview": "import threading\n\nfrom peewee import *\nfrom peewee import Alias\nfrom peewee import CompoundSelectQuery\nfrom peewee impor"
  },
  {
    "path": "playhouse/signals.py",
    "chars": 2511,
    "preview": "\"\"\"\nProvide django-style hooks for model events.\n\"\"\"\nfrom peewee import Model as _Model\n\n\nclass Signal(object):\n    def "
  },
  {
    "path": "playhouse/sqlcipher_ext.py",
    "chars": 3404,
    "preview": "\"\"\"\nPeewee integration with pysqlcipher.\n\nProject page: https://github.com/leapcode/pysqlcipher/\n\n**WARNING!!! EXPERIMEN"
  },
  {
    "path": "playhouse/sqlite_changelog.py",
    "chars": 4793,
    "preview": "from peewee import *\nfrom playhouse.sqlite_ext import JSONField\n\n\nclass BaseChangeLog(Model):\n    timestamp = DateTimeFi"
  },
  {
    "path": "playhouse/sqlite_ext.py",
    "chars": 27456,
    "preview": "import json\nimport re\nimport sys\nimport warnings\n\nfrom peewee import *\nfrom peewee import ColumnBase\nfrom peewee import "
  },
  {
    "path": "playhouse/sqlite_udf.py",
    "chars": 16366,
    "preview": "import collections\nimport datetime\nimport heapq\nimport json\nimport math\nimport os\nimport random\nimport re\nimport struct\n"
  },
  {
    "path": "playhouse/sqliteq.py",
    "chars": 10724,
    "preview": "import logging\nimport weakref\nfrom queue import Queue\nfrom threading import local as thread_local\nfrom threading import "
  },
  {
    "path": "playhouse/test_utils.py",
    "chars": 1854,
    "preview": "from functools import wraps\nimport logging\n\n\nlogger = logging.getLogger('peewee')\n\n\nclass _QueryLogHandler(logging.Handl"
  },
  {
    "path": "pwiz.py",
    "chars": 8190,
    "preview": "#!/usr/bin/env python\n\nimport datetime\nimport os\nimport sys\nfrom getpass import getpass\nfrom optparse import OptionParse"
  },
  {
    "path": "pyproject.toml",
    "chars": 1228,
    "preview": "[build-system]\nrequires = [\"setuptools\", \"wheel\", \"cython\"]\nbuild-backend=\"setuptools.build_meta\"\n\n[project]\nname = \"pee"
  },
  {
    "path": "runtests.py",
    "chars": 5289,
    "preview": "#!/usr/bin/env python\nimport optparse\nimport os\nimport shutil\nimport sys\nimport unittest\n\n\nUSER = os.environ.get('USER')"
  },
  {
    "path": "setup.py",
    "chars": 891,
    "preview": "import platform\nimport os\nfrom setuptools import setup\nfrom setuptools.extension import Extension\ntry:\n    from Cython.B"
  },
  {
    "path": "tests/__init__.py",
    "chars": 2208,
    "preview": "import sys\nimport unittest\n\nfrom peewee import OperationalError\n\n# Core modules.\nfrom .db_tests import *\nfrom .expressio"
  },
  {
    "path": "tests/__main__.py",
    "chars": 1255,
    "preview": "import os\nimport sys\nimport unittest\n\nsrc_dir = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))\nsys.path.in"
  },
  {
    "path": "tests/apsw_ext.py",
    "chars": 5980,
    "preview": "import apsw\nimport datetime\n\nfrom playhouse.apsw_ext import *\nfrom .base import ModelTestCase\nfrom .base import TestMode"
  },
  {
    "path": "tests/base.py",
    "chars": 10364,
    "preview": "from contextlib import contextmanager\nfrom functools import wraps\nimport datetime\nimport logging\nimport os\nimport re\nimp"
  },
  {
    "path": "tests/base_models.py",
    "chars": 2430,
    "preview": "from peewee import *\n\nfrom .base import TestModel\n\n\nclass Person(TestModel):\n    first = CharField()\n    last = CharFiel"
  },
  {
    "path": "tests/cockroachdb.py",
    "chars": 13785,
    "preview": "import datetime\nimport uuid\n\nfrom peewee import *\nfrom playhouse.cockroachdb import *\n\nfrom .base import IS_CRDB\nfrom .b"
  },
  {
    "path": "tests/cysqlite_ext.py",
    "chars": 7995,
    "preview": "import glob\nimport os\n\nimport cysqlite\n\nfrom peewee import *\nfrom playhouse.cysqlite_ext import *\n\nfrom .base import Bas"
  },
  {
    "path": "tests/dataset.py",
    "chars": 23641,
    "preview": "import csv\nimport datetime\nimport json\nimport operator\nimport os\nimport tempfile\nfrom io import StringIO\n\nfrom peewee im"
  },
  {
    "path": "tests/db_tests.py",
    "chars": 34963,
    "preview": "from itertools import permutations\nfrom queue import Queue\nimport platform\nimport re\nimport threading\n\nfrom peewee impor"
  },
  {
    "path": "tests/db_url.py",
    "chars": 3532,
    "preview": "from peewee import *\nfrom playhouse.db_url import connect\nfrom playhouse.db_url import parse\n\nfrom .base import BaseTest"
  },
  {
    "path": "tests/expressions.py",
    "chars": 6949,
    "preview": "from peewee import *\n\nfrom .base import IS_SQLITE\nfrom .base import ModelTestCase\nfrom .base import TestModel\nfrom .base"
  },
  {
    "path": "tests/extra_fields.py",
    "chars": 1488,
    "preview": "from peewee import *\nfrom playhouse.fields import CompressedField\nfrom playhouse.fields import PickleField\n\nfrom .base i"
  },
  {
    "path": "tests/fields.py",
    "chars": 53794,
    "preview": "import calendar\nimport datetime\nimport sqlite3\nimport time\nimport uuid\nfrom decimal import Decimal as D\nfrom decimal imp"
  },
  {
    "path": "tests/hybrid.py",
    "chars": 5246,
    "preview": "from peewee import *\nfrom playhouse.hybrid import *\n\nfrom .base import ModelTestCase\nfrom .base import TestModel\nfrom .b"
  },
  {
    "path": "tests/keys.py",
    "chars": 17972,
    "preview": "from peewee import *\n\nfrom .base import IS_MYSQL\nfrom .base import IS_SQLITE\nfrom .base import ModelTestCase\nfrom .base "
  },
  {
    "path": "tests/kv.py",
    "chars": 3820,
    "preview": "from peewee import IntegerField\nfrom playhouse.kv import KeyValue\n\nfrom .base import DatabaseTestCase\nfrom .base import "
  },
  {
    "path": "tests/manytomany.py",
    "chars": 22642,
    "preview": "from peewee import *\n\nfrom .base import ModelTestCase\nfrom .base import TestModel\nfrom .base import get_in_memory_db\nfro"
  },
  {
    "path": "tests/migrations.py",
    "chars": 36634,
    "preview": "import datetime\nimport os\nfrom functools import partial\n\nfrom peewee import *\nfrom playhouse.migrate import *\nfrom .base"
  },
  {
    "path": "tests/model_save.py",
    "chars": 5101,
    "preview": "from peewee import *\n\nfrom .base import ModelTestCase\nfrom .base import TestModel\nfrom .base import requires_pglike\n\n\ncl"
  },
  {
    "path": "tests/model_sql.py",
    "chars": 51822,
    "preview": "import datetime\n\nfrom peewee import *\nfrom peewee import Alias\nfrom peewee import Database\nfrom peewee import ModelIndex"
  },
  {
    "path": "tests/models.py",
    "chars": 190422,
    "preview": "import datetime\nimport threading\nimport time\nimport unittest\nfrom unittest import mock\n\nfrom peewee import *\nfrom peewee"
  },
  {
    "path": "tests/mysql_ext.py",
    "chars": 4533,
    "preview": "import datetime\n\nfrom peewee import *\nfrom playhouse.mysql_ext import JSONField\nfrom playhouse.mysql_ext import Match\n\nf"
  },
  {
    "path": "tests/pool.py",
    "chars": 29835,
    "preview": "import heapq\nimport os\nimport threading\nimport time\n\nfrom peewee import *\nfrom peewee import _savepoint\nfrom peewee impo"
  },
  {
    "path": "tests/postgres.py",
    "chars": 39996,
    "preview": "#coding:utf-8\nimport datetime\nimport functools\nimport json\nimport os\nimport uuid\nfrom decimal import Decimal as Dc\nfrom "
  },
  {
    "path": "tests/postgres_helpers.py",
    "chars": 15948,
    "preview": "from peewee import Cast\n\n\nclass BaseJsonFieldTestCase(object):\n    # Subclasses must define these, as well as specifying"
  },
  {
    "path": "tests/prefetch_tests.py",
    "chars": 25610,
    "preview": "from peewee import *\n\nfrom .base import get_in_memory_db\nfrom .base import requires_models\nfrom .base import ModelTestCa"
  },
  {
    "path": "tests/pwasyncio.py",
    "chars": 58388,
    "preview": "import asyncio\nimport collections\nimport contextvars\nimport glob\nimport itertools\nimport tempfile\nimport os\nimport unitt"
  },
  {
    "path": "tests/pwasyncio_stress.py",
    "chars": 8694,
    "preview": "import asyncio\nimport os\nimport random\nimport sys\nimport time\nimport tracemalloc\nfrom playhouse.pwasyncio import *\n\n\ndef"
  },
  {
    "path": "tests/pwiz_integration.py",
    "chars": 8878,
    "preview": "import datetime\nimport os\nimport textwrap\nimport sys\nfrom io import StringIO\nfrom unittest import mock\n\nfrom peewee impo"
  },
  {
    "path": "tests/pydantic_utils.py",
    "chars": 14819,
    "preview": "from __future__ import annotations\n\nimport datetime\nimport decimal\nimport uuid\nfrom typing import List\n\nfrom peewee impo"
  },
  {
    "path": "tests/queries.py",
    "chars": 7472,
    "preview": "from peewee import *\n\nfrom .base import BaseTestCase\nfrom .base import DatabaseTestCase\nfrom .base import TestModel\nfrom"
  },
  {
    "path": "tests/reflection.py",
    "chars": 23540,
    "preview": "import datetime\nimport os\nimport re\nimport warnings\n\nfrom peewee import *\nfrom playhouse.reflection import *\n\nfrom .base"
  },
  {
    "path": "tests/regressions.py",
    "chars": 68050,
    "preview": "import datetime\nimport json\nimport random\nimport threading\nimport time\nimport uuid\n\nfrom peewee import *\nfrom playhouse."
  },
  {
    "path": "tests/results.py",
    "chars": 10897,
    "preview": "import datetime\n\nfrom peewee import *\n\nfrom .base import get_in_memory_db\nfrom .base import ModelTestCase\nfrom .base_mod"
  },
  {
    "path": "tests/returning.py",
    "chars": 3613,
    "preview": "import unittest\n\nfrom peewee import *\nfrom peewee import __sqlite_version__\n\nfrom .base import db\nfrom .base import skip"
  },
  {
    "path": "tests/schema.py",
    "chars": 35643,
    "preview": "import datetime\n\nfrom peewee import *\nfrom peewee import NodeList\n\nfrom .base import BaseTestCase\nfrom .base import get_"
  },
  {
    "path": "tests/shortcuts.py",
    "chars": 31469,
    "preview": "import operator\n\nfrom peewee import *\nfrom playhouse.shortcuts import *\n\nfrom .base import BaseTestCase\nfrom .base impor"
  },
  {
    "path": "tests/signals.py",
    "chars": 6176,
    "preview": "from peewee import *\nfrom playhouse import signals\n\nfrom .base import get_in_memory_db\nfrom .base import ModelTestCase\n\n"
  },
  {
    "path": "tests/sql.py",
    "chars": 105049,
    "preview": "import datetime\nimport re\n\nfrom peewee import *\nfrom peewee import Expression\nfrom peewee import Function\nfrom peewee im"
  },
  {
    "path": "tests/sqlcipher_ext.py",
    "chars": 5445,
    "preview": "import datetime\nimport os\nfrom hashlib import sha1\n\nfrom peewee import DatabaseError\nfrom playhouse.sqlcipher_ext import"
  },
  {
    "path": "tests/sqlite.py",
    "chars": 75403,
    "preview": "from decimal import Decimal as D\nimport datetime\nimport os\nimport sys\n\nfrom peewee import *\nfrom peewee import sqlite3\nf"
  },
  {
    "path": "tests/sqlite_changelog.py",
    "chars": 6037,
    "preview": "import datetime\n\nfrom peewee import *\nfrom playhouse.sqlite_changelog import ChangeLog\nfrom playhouse.sqlite_ext import "
  },
  {
    "path": "tests/sqlite_helpers.py",
    "chars": 895,
    "preview": "from peewee import sqlite3\n\n\ndef json_installed():\n    if sqlite3.sqlite_version_info < (3, 9, 0):\n        return False\n"
  },
  {
    "path": "tests/sqlite_udf.py",
    "chars": 13876,
    "preview": "import datetime\nimport json\nimport random\n\nfrom peewee import *\nfrom peewee import sqlite3\nfrom playhouse.sqlite_udf imp"
  },
  {
    "path": "tests/sqliteq.py",
    "chars": 7401,
    "preview": "import os\nimport sys\nimport threading\nimport time\nimport unittest\nfrom functools import partial\n\ntry:\n    import gevent\n"
  },
  {
    "path": "tests/test_utils.py",
    "chars": 2541,
    "preview": "import functools\n\nfrom .base import ModelTestCase\nfrom .base import TestModel\n\nfrom peewee import *\nfrom playhouse.test_"
  },
  {
    "path": "tests/transactions.py",
    "chars": 14782,
    "preview": "import threading\n\nfrom peewee import *\n\nfrom .base import DatabaseTestCase\nfrom .base import IS_CRDB\nfrom .base import I"
  }
]

About this extraction

This page contains the full source code of the coleifer/peewee GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 167 files (2.7 MB), approximately 725.6k tokens, and a symbol index with 4557 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!