Query-builder Internals Query-builder Internals class AliasManager Manages the aliases assigned to Source objects in SELECTqueries, so as to avoid ambiguous references whe...
Foreign Keys and Joins Traversing foreign keys Joining tables Selecting from multiple models Multiple Foreign Keys to the Same Model Joining on arbitrary fields Joining on Mul...
Atomic updates Upsert Atomic updates Peewee allows you to perform atomic updates. Let’s suppose we need to update some counters. The naive approach would be to write something...
Using Postgresql Isolation level Using Postgresql To connect to a Postgresql database, we will usePostgresqlDatabase . The first parameter is always the name of thedatabase, ...
Database Working with existing databases Database We’re done with our database, let’s close the connection: db . close () In an actual application, there are some estab...
Hacks Optimistic Locking Top object per group Top N objects per group Postgres lateral joins Window functions Other methods Writing custom functions with SQLite Date math ...
Creating model tables Creating model tables In order to start using our models, its necessary to open a connection to the database and create the tables first. Peewee will run ...
Hacks Optimistic Locking Top object per group Top N objects per group Postgres lateral joins Window functions Other methods Writing custom functions with SQLite Hacks Co...
DataSet Getting started Storing data Importing data Using transactions Inspecting the database Reading data Exporting data API DataSet The dataset module contains a hig...