{
  "id": "task_libraries:sqlite/python",
  "path": "/exapedia/python-sqlite-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python SQLite libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python SQLite libraries read and write SQLite database files from Python code, beyond the "
    },
    {
      "t": "fact",
      "fact": "F74"
    },
    {
      "t": "text",
      "text": " module in the standard library. A library either adds an ORM or query layer or exposes the SQLite C API more directly than the standard module does. These libraries let desktop apps, test suites, and AI agents keep structured local data without a database server."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python SQLite libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#sqlalchemy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F129"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#aiosqlite",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F147"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#peewee",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F169"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlmodel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#apsw",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F199"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlite-utils",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F215"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pysqlitethree-binary",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlcipherthree",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F249"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#sqlalchemy",
          "label": [
            {
              "t": "text",
              "text": "SQLAlchemy"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F130"
        },
        {
          "t": "text",
          "text": ", a count that covers all its database work."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "ORM model classes",
            "AsyncIO query interface"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#sqlalchemy",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F129"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#aiosqlite",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F147"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#peewee",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F165"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlmodel",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#apsw",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F199"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F208"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlite-utils",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F215"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F224"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#pysqlitethree-binary",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#sqlcipherthree",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F249"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F260"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "sqlalchemy",
          "name": [
            {
              "t": "fact",
              "fact": "F129"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/sqlalchemy/sqlalchemy"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sqlalchemy"
            },
            {
              "label": "Docs",
              "href": "https://docs.sqlalchemy.org/en/21/tutorial/dbapi_transactions.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F136"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F130"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.sqlalchemy.org/en/21/tutorial/dbapi_transactions.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F129"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/PrefectHQ/prefect",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F145"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def begin_sqlite_stmt(self, conn: sa.Connection) -> None:\n    # emit our own BEGIN\n    # requires `begin_sqlite_conn`\n    # see https://docs.sqlalchemy.org/en/20/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl\n    mode = SQLITE_BEGIN_MODE.get()\n    if mode is not None:\n        conn.exec_driver_sql(f\"BEGIN {mode}\")\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/PrefectHQ/prefect/blob/ec4b188a19371cb79bc91afe897042bca3a3c95f/src/prefect/server/database/configurations.py#L594-L600",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=sqlalchemy%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F129"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sqlalchemy import create_engine, text\nengine = create_engine(\"sqlite+pysqlite:///:memory:\")\nwith engine.connect() as connection:\n    print(connection.execute(text(\"SELECT 1\")).scalar())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.sqlalchemy.org/en/21/tutorial/dbapi_transactions.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "dbapi_transactions.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F134"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "aiosqlite",
          "name": [
            {
              "t": "fact",
              "fact": "F147"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/omnilib/aiosqlite"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/aiosqlite"
            },
            {
              "label": "Docs",
              "href": "https://aiosqlite.omnilib.dev/en/stable/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F154"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://aiosqlite.omnilib.dev/en/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F147"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/langchain-ai/langgraph",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "async def setup(self) -> None:\n    \"\"\"Set up the checkpoint database asynchronously.\n\n    This method creates the necessary tables in the SQLite database if they don't\n    already exist. It is called automatically when needed and should not be called\n    directly by the user.\n    \"\"\"\n    async with self.lock:\n        if self.is_setup:\n            return\n        await _ensure_connected(self.conn)\n        async with self.conn.executescript(\n            \"\"\"\n            PRAGMA journal_mode=WAL;\n            CREATE TABLE IF NOT EXISTS checkpoints (\n                thread_id TEXT NOT NULL,\n                checkpoint_ns TEXT NOT NULL DEFAULT '',\n                checkpoint_id TEXT NOT NULL,\n                parent_checkpoint_id TEXT,\n                type TEXT,\n                checkpoint BLOB,\n                metadata BLOB,\n                PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)\n            );\n            CREATE TABLE IF NOT EXISTS writes (\n                thread_id TEXT NOT NULL,\n                checkpoint_ns TEXT NOT NULL DEFAULT '',\n                checkpoint_id TEXT NOT NULL,\n                task_id TEXT NOT NULL,\n                task_path TEXT NOT NULL DEFAULT '',\n                idx INTEGER NOT NULL,\n                channel TEXT NOT NULL,\n                type TEXT,\n                value BLOB,\n                PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id, task_id, idx)\n            );\n            \"\"\"\n        ):\n            await self.conn.commit()\n\n        # sqlite has no ADD COLUMN IF NOT EXISTS; this migrates databases\n        # created before `task_path` existed and is a no-op on the rest.\n        try:\n            await self.conn.execute(\n                \"ALTER TABLE writes ADD COLUMN task_path TEXT NOT NULL DEFAULT ''\"\n            )\n            await self.conn.commit()\n        except aiosqlite.OperationalError as e:\n            # A read-only database from before the column can still be read;\n            # its rows would all read back as '' anyway.\n            if \"readonly database\" in str(e):\n                self._has_task_path = False\n            elif \"duplicate column name\" not in str(e):\n                raise\n\n        self.is_setup = True\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/langchain-ai/langgraph/blob/7830b91a24e657a8167e2dbf40c3fa5a77ef5d93/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py#L317-L372",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F162"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=aiosqlite%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F147"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import asyncio\nimport aiosqlite\nasync def main():\n    async with aiosqlite.connect(\":memory:\") as db:\n        async with db.execute(\"SELECT 1\") as cursor:\n            print(await cursor.fetchone())\nasyncio.run(main())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://aiosqlite.omnilib.dev/en/stable/",
                  "label": [
                    {
                      "t": "text",
                      "text": "index.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F152"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "peewee",
          "name": [
            {
              "t": "fact",
              "fact": "F165"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/coleifer/peewee"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/peewee"
            },
            {
              "label": "Docs",
              "href": "https://docs.peewee-orm.com/en/latest/peewee/api.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F11"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F168"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.peewee-orm.com/en/latest/peewee/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F165"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F12"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/sqlite-web",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def initialize_dataset(filename):\n    dataset_kw = {}\n    if peewee_version >= (3, 14, 9):\n        dataset_kw['include_views'] = True\n\n    if dataset_config['read_only']:\n        if peewee_version < (3, 5, 1):\n            die('Peewee 3.5.1 or newer is required for read-only access.')\n        db = SqliteDatabase('file:%s?mode=ro' % filename, uri=True)\n        try:\n            db.connect()\n        except OperationalError:\n            die('Unable to open database file in read-only mode. Ensure that '\n                'the database exists in order to use read-only mode.')\n        db.close()\n    else:\n        db = SqliteDatabase(filename)\n\n    if dataset_config['foreign_keys']:\n        db.pragma('foreign_keys', True, permanent=True)\n\n    if dataset_config['extensions']:\n        # Load extensions before performing introspection.\n        for ext in dataset_config['extensions']:\n            db.load_extension(ext)\n\n    if dataset_config['startup_hook']:\n        dataset_config['startup_hook'](db)\n\n    dataset = SqliteDataSet(db, **dataset_kw)\n    dataset.ensure_cache()\n    dataset.close()\n    return dataset\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/sqlite-web/blob/8c72947e63d6363f7b090801965e8321200283ba/sqlite_web/sqlite_web.py#L1879-L1911",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F178"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20peewee%20for%20SQLite%20backups%20checkpoint%20persistence%20schema%20migrations%20and%20database%20introspection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F165"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from peewee import SqliteDatabase\ndb = SqliteDatabase(\":memory:\")\nprint(db.execute_sql(\"SELECT 1\").fetchone())\ndb.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.peewee-orm.com/en/latest/peewee/api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "quickstart.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sqlmodel",
          "name": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/fastapi/sqlmodel"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sqlmodel"
            },
            {
              "label": "Docs",
              "href": "https://sqlmodel.tiangolo.com/tutorial/select/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F188"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://sqlmodel.tiangolo.com/tutorial/select/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F181"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/fastapi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F197"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@app.get(\"/heroes/\")\ndef read_heroes(\n    session: SessionDep,\n    offset: int = 0,\n    limit: Annotated[int, Query(le=100)] = 100,\n) -> list[Hero]:\n    heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()\n    return heroes\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/fastapi/fastapi/blob/05e6df7e906c3decba377c37548019973f40bf15/docs_src/sql_databases/tutorial001.py#L48-L55",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F196"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=sqlmodel%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F181"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sqlmodel import Field, Session, SQLModel, create_engine, select\nclass Hero(SQLModel, table=True):\n    id: int | None = Field(default=None, primary_key=True)\n    name: str\nengine = create_engine(\"sqlite:///:memory:\")\nSQLModel.metadata.create_all(engine)\nwith Session(engine) as session:\n    print(session.exec(select(Hero)).all())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://sqlmodel.tiangolo.com/tutorial/create-db-and-table/",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F186"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "apsw",
          "name": [
            {
              "t": "fact",
              "fact": "F199"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/rogerbinns/apsw"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/apsw"
            },
            {
              "label": "Docs",
              "href": "https://rogerbinns.github.io/apsw/connection.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F37"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F200"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://rogerbinns.github.io/apsw/connection.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F199"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/kovidgoyal/calibre",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F213"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _backup_database(self, path: str, name: str, extra_sql: str = '', num_of_retries: int = 10, busy_timeout: float = 60) -> None:\n    for retry_count in range(num_of_retries):\n        try:\n            with closing(apsw.Connection(path)) as dest_db:\n                with dest_db.backup('main', self.conn, name) as b:\n                    busy_since = None\n                    while not b.done:\n                        try:\n                            b.step(128)\n                        except apsw.BusyError as e:\n                            # Locks on some filesystems such as SMB/CIFS\n                            # shares never succeed, so dont retry forever\n                            now = time.monotonic()\n                            if busy_since is None:\n                                busy_since = now\n                            elif now - busy_since > busy_timeout:\n                                raise apsw.BusyError(\n                                    f'Could not lock the database at {path} for {busy_timeout} seconds.'\n                                    ' The filesystem it is on probably does not support file locking.'\n                                ) from e\n                            time.sleep(0.05)\n                        else:\n                            busy_since = None\n                if extra_sql:\n                    dest_db.cursor().execute(extra_sql)\n            return\n        except apsw.IOError as e:\n            # backup step() can fail transiently, either with\n            # SQLITE_IOERR_SHORT_READ when the source database is modified\n            # while it is being read, or with a plain SQLITE_IOERR and no\n            # error message set on the connection, which apsw reports as\n            # \"not an error\". Once step() fails the backup object is dead,\n            # so restart the entire backup. Any other extended result code\n            # is a genuine I/O error, and is not retried.\n            if retry_count >= num_of_retries - 1 or getattr(e, 'extendedresult', None) not in (apsw.SQLITE_IOERR, apsw.SQLITE_IOERR_SHORT_READ):\n                raise\n            with suppress(OSError):\n                os.remove(path)\n            time.sleep(0.2)\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/kovidgoyal/calibre/blob/8d119ee9e310918c3693200a9b357bdc98b5884d/src/calibre/db/backend.py#L3326-L3364",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F212"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20apsw%20for%20SQLite%20backups%20checkpoint%20persistence%20schema%20migrations%20and%20database%20introspection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F199"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import apsw\nwith apsw.Connection(\":memory:\") as connection:\n    print(connection.execute(\"SELECT 1\").fetchone())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://rogerbinns.github.io/apsw/connection.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "pysqlite.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F204"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sqlite-utils",
          "name": [
            {
              "t": "fact",
              "fact": "F215"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/simonw/sqlite-utils"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sqlite-utils"
            },
            {
              "label": "Docs",
              "href": "https://sqlite-utils.datasette.io/en/stable/python-api.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F61"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://sqlite-utils.datasette.io/en/stable/python-api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F215"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F62"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F63"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/simonw/llm",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "@migration\ndef m014_schemas(db):\n    db[\"schemas\"].create(\n        {\n            \"id\": str,\n            \"content\": str,\n        },\n        pk=\"id\",\n    )\n    db[\"responses\"].add_column(\"schema_id\", str, fk=\"schemas\", fk_col=\"id\")\n    # Clean up SQL create table indentation\n    db[\"responses\"].transform()\n    # These changes may have dropped the FTS configuration, fix that\n    db[\"responses\"].enable_fts(\n        [\"prompt\", \"response\"], create_triggers=True, replace=True\n    )\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/simonw/llm/blob/2216eb1446cf74b93da7ef0f107d2c1982fd611e/llm/migrations.py#L241-L256",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F228"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Python%20projects%20using%20sqlite-utils%20for%20SQLite%20backups%20checkpoint%20persistence%20schema%20migrations%20and%20database%20introspection&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F215"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sqlite_utils import Database\ndb = Database(memory=True)\nprint(db.execute(\"SELECT 1\").fetchone())\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://sqlite-utils.datasette.io/en/stable/python-api.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "python-api.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F220"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "pysqlitethree-binary",
          "name": [
            {
              "t": "fact",
              "fact": "F231"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/coleifer/pysqlite3"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/pysqlite3-binary"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F238"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/pysqlite3",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F231"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/simonw/sqlite-utils",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F247"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def __init__(\n    self,\n    filename_or_conn: str | pathlib.Path | sqlite3.Connection | None = None,\n    memory: bool = False,\n    memory_name: str | None = None,\n    recreate: bool = False,\n    recursive_triggers: bool = True,\n    tracer: Tracer | None = None,\n    use_counts_table: bool = False,\n    execute_plugins: bool = True,\n    use_old_upsert: bool = False,\n    strict: bool = False,\n):\n    self.memory_name = None\n    self.memory = False\n    self.use_old_upsert = use_old_upsert\n    if not (\n        (filename_or_conn is not None and (not memory and not memory_name))\n        or (filename_or_conn is None and (memory or memory_name))\n    ):\n        raise ValueError(\"Either specify a filename_or_conn or pass memory=True\")\n    if memory_name:\n        uri = f\"file:{memory_name}?mode=memory&cache=shared\"\n        self.conn = sqlite3.connect(\n            uri,\n            uri=True,\n            check_same_thread=False,\n        )\n        self.memory = True\n        self.memory_name = memory_name\n    elif memory or filename_or_conn == \":memory:\":\n        self.conn = sqlite3.connect(\":memory:\")\n        self.memory = True\n    elif isinstance(filename_or_conn, (str, pathlib.Path)):\n        if recreate and os.path.exists(filename_or_conn):\n            try:\n                os.remove(filename_or_conn)\n            except OSError:\n                # Avoid mypy and __repr__ errors, see:\n                # https://github.com/simonw/sqlite-utils/issues/503\n                self.conn = sqlite3.connect(\":memory:\")\n                raise\n        self.conn = sqlite3.connect(str(filename_or_conn))\n    else:\n        if recreate:\n            raise ValueError(\"recreate cannot be used with connections, only paths\")\n        self.conn = cast(sqlite3.Connection, filename_or_conn)\n        # Python 3.12+ autocommit=True/False connections make commit()\n        # and rollback() behave differently, silently breaking the\n        # transaction handling used by every write method\n        autocommit = getattr(self.conn, \"autocommit\", None)\n        if autocommit is not None and autocommit != getattr(\n            sqlite3, \"LEGACY_TRANSACTION_CONTROL\", -1\n        ):\n            raise TransactionError(\n                \"sqlite-utils requires a connection that uses the default \"\n                \"transaction handling - connections created with \"\n                \"autocommit=True or autocommit=False are not supported\"\n            )\n    self._tracer: Tracer | None = tracer\n    if recursive_triggers:\n        self.execute(\"PRAGMA recursive_triggers=on;\")\n    self._registered_functions: set = set()\n    self.use_counts_table = use_counts_table\n    if execute_plugins:\n        ensure_plugins_loaded()\n        pm.hook.prepare_connection(conn=self.conn)\n    self.strict = strict\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/simonw/sqlite-utils/blob/9c66bafa52ae23d40499c74b0db3b635bcddb876/sqlite_utils/db.py#L569-L636",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=pysqlite3-binary%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F231"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from pysqlite3 import dbapi2\nconnection = dbapi2.connect(\":memory:\")\nconnection.execute(\"CREATE TABLE demo (id INTEGER PRIMARY KEY)\")\nconnection.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/pysqlite3/blob/master/pysqlite3/dbapi2.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "sqlcipherthree",
          "name": [
            {
              "t": "fact",
              "fact": "F249"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/coleifer/sqlcipher3"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/sqlcipher3"
            },
            {
              "label": "Docs",
              "href": "https://github.com/coleifer/sqlcipher3/blob/master/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F256"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F258"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F252"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/sqlcipher3/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F249"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F265"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F266"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/peewee",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F265"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def _connect(self):\n    params = dict(self.connect_params)\n    passphrase = params.pop('passphrase', '').replace(\"'\", \"''\")\n\n    conn = sqlcipher.connect(self.database, isolation_level=None, **params)\n    try:\n        if passphrase:\n            conn.execute(\"PRAGMA key='%s'\" % passphrase)\n        self._add_conn_hooks(conn)\n    except:\n        conn.close()\n        raise\n    return conn\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/peewee/blob/a832f70cf46d581dd2d87ac713e1dcbef364c25a/playhouse/sqlcipher_ext.py#L36-L48",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F264"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=sqlcipher3%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F249"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from sqlcipher3 import dbapi2\nconnection = dbapi2.connect(\":memory:\")\nconnection.execute(\"PRAGMA key='replace-with-a-secret'\")\nconnection.execute(\"CREATE TABLE demo (id INTEGER PRIMARY KEY)\")\nconnection.close()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/coleifer/sqlcipher3/blob/master/sqlcipher3/dbapi2.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F254"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python SQLite library should I use?",
      "a": [
        {
          "t": "text",
          "text": "The standard library's "
        },
        {
          "t": "fact",
          "fact": "F74"
        },
        {
          "t": "text",
          "text": " module covers direct SQL. "
        },
        {
          "t": "link",
          "href": "#sqlalchemy",
          "label": [
            {
              "t": "text",
              "text": "SQLAlchemy"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#peewee",
          "label": [
            {
              "t": "text",
              "text": "Peewee"
            }
          ]
        },
        {
          "t": "text",
          "text": " suit applications that want an ORM over SQLite. "
        },
        {
          "t": "link",
          "href": "#aiosqlite",
          "label": [
            {
              "t": "text",
              "text": "aiosqlite"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits asyncio code. "
        },
        {
          "t": "link",
          "href": "#apsw",
          "label": [
            {
              "t": "text",
              "text": "APSW"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits code that needs the full SQLite C API, such as online backups."
        }
      ]
    },
    {
      "q": "What is Peewee?",
      "a": [
        {
          "t": "link",
          "href": "#peewee",
          "label": [
            {
              "t": "text",
              "text": "Peewee"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a small ORM with models, queries, and SQLite database helpers. It also has a separate asyncio API."
        }
      ]
    },
    {
      "q": "Which SQLite interface comes with Python?",
      "a": [
        {
          "t": "text",
          "text": "The "
        },
        {
          "t": "fact",
          "fact": "F74"
        },
        {
          "t": "text",
          "text": " module exposes SQLite through the standard library. It ships with Python and needs no install."
        }
      ]
    },
    {
      "q": "What is SQLModel?",
      "a": [
        {
          "t": "link",
          "href": "#sqlmodel",
          "label": [
            {
              "t": "text",
              "text": "SQLModel"
            }
          ]
        },
        {
          "t": "text",
          "text": " defines database tables as Pydantic-backed model classes that work with SQLAlchemy."
        }
      ]
    },
    {
      "q": "What is aiosqlite?",
      "a": [
        {
          "t": "link",
          "href": "#aiosqlite",
          "label": [
            {
              "t": "text",
              "text": "aiosqlite"
            }
          ]
        },
        {
          "t": "text",
          "text": " is an asyncio bridge to the standard "
        },
        {
          "t": "fact",
          "fact": "F74"
        },
        {
          "t": "text",
          "text": " module. It runs database operations on a dedicated worker thread per connection. Code awaits each result."
        }
      ]
    },
    {
      "q": "What is APSW?",
      "a": [
        {
          "t": "link",
          "href": "#apsw",
          "label": [
            {
              "t": "text",
              "text": "APSW"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a Python wrapper for the SQLite C API, with incremental backups and built-in async operation."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, peewee",
      "display": "Peewee",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, peewee",
      "display": "41.7M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, peewee",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, peewee",
      "display": "4.5.3, Oct 2026",
      "asOf": "2026-10-07"
    },
    "F5": {
      "label": "Package release date, peewee",
      "display": "Oct 2026",
      "asOf": "2026-10-07"
    },
    "F6": {
      "label": "Repository stars, peewee",
      "display": "12.0K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Async API, peewee",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "SQL functions, peewee",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Bulk inserts, peewee",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Install, peewee",
      "display": "pip install peewee",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "What it does, peewee",
      "display": "Maps Python models and query expressions to SQLite tables and SQL.",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "strengths lead, peewee",
      "display": "Models express related SQLite tables",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths, peewee",
      "display": "Declare model fields and foreign keys for related records.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, peewee",
      "display": "Configures SQLite connection pragmas",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, peewee",
      "display": "Set journal mode and foreign-key enforcement when constructing SqliteDatabase.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "limitations lead, peewee",
      "display": "Async SQLite needs another driver",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations, peewee",
      "display": "Install aiosqlite when using AsyncSqliteDatabase.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, peewee",
      "display": "In-memory async databases share connections",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, peewee",
      "display": "Pool size does not add connections to an in-memory database.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "Quickstart, peewee",
      "display": "import datetime\nfrom peewee import *\n\n# An in-memory SQLite database. Or use PostgresqlDatabase or MySQLDatabase.\ndb = SqliteDatabase(':memory:')\n\nclass BaseModel(Model):\n    class Meta:\n        database = db\n\nclass User(BaseModel):\n    username = TextField(unique=True)\n\nclass Tweet(BaseModel):\n    user = ForeignKeyField(User, backref='tweets')\n    content = TextField()\n    timestamp = DateTimeField(\n        default=datetime.datetime.now,\n        index=True)\n\n\ndb.connect()\ndb.create_tables([User, Tweet])\n\n\n# One-step creation - returns the saved instance.\ncharlie = User.create(username='charlie')\nhuey = User.create(username='huey')\n\n# Two-step creation.\nt = Tweet(user=charlie, content='Hello, world!')\nt.save()\n\nTweet.create(user=charlie, content='My second tweet.')\nTweet.create(user=huey, content='meow')\n\n\n# Select each tweet with its author in one query.\nquery = (Tweet\n         .select(Tweet, User)\n         .join(User)\n         .order_by(Tweet.timestamp.desc()))\n\nfor tweet in query:\n    print(tweet.user.username, '->', tweet.content)\n\n\ndb.close()\n\n",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Project function, peewee",
      "display": "def initialize_dataset(filename):\n    dataset_kw = {}\n    if peewee_version >= (3, 14, 9):\n        dataset_kw['include_views'] = True\n\n    if dataset_config['read_only']:\n        if peewee_version < (3, 5, 1):\n            die('Peewee 3.5.1 or newer is required for read-only access.')\n        db = SqliteDatabase('file:%s?mode=ro' % filename, uri=True)\n        try:\n            db.connect()\n        except OperationalError:\n            die('Unable to open database file in read-only mode. Ensure that '\n                'the database exists in order to use read-only mode.')\n        db.close()\n    else:\n        db = SqliteDatabase(filename)\n\n    if dataset_config['foreign_keys']:\n        db.pragma('foreign_keys', True, permanent=True)\n\n    if dataset_config['extensions']:\n        # Load extensions before performing introspection.\n        for ext in dataset_config['extensions']:\n            db.load_extension(ext)\n\n    if dataset_config['startup_hook']:\n        dataset_config['startup_hook'](db)\n\n    dataset = SqliteDataSet(db, **dataset_kw)\n    dataset.ensure_cache()\n    dataset.close()\n    return dataset\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function reference, peewee",
      "display": "sqlite_web.py · initialize_dataset()",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project repository, peewee",
      "display": "coleifer/sqlite-web",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project stars, coleifer/sqlite-web",
      "display": "4.2K",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project push date, coleifer/sqlite-web",
      "display": "Nov 2026",
      "asOf": "2026-11-05"
    },
    "F26": {
      "label": "Library name, apsw",
      "display": "APSW",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Monthly downloads, apsw",
      "display": "2.5M",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "License, apsw",
      "display": "any-OSI",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Package release, apsw",
      "display": "3.54.1.0, Oct 2026",
      "asOf": "2026-10-19"
    },
    "F30": {
      "label": "Package release date, apsw",
      "display": "Oct 2026",
      "asOf": "2026-10-19"
    },
    "F31": {
      "label": "Repository stars, apsw",
      "display": "955",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Async API, apsw",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Online backups, apsw",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "SQL functions, apsw",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Bulk inserts, apsw",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Install, apsw",
      "display": "pip install apsw",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "What it does, apsw",
      "display": "Connects Python to SQLite’s complete C API, including async operation.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, apsw",
      "display": "Exposes SQLite-specific extension APIs",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, apsw",
      "display": "Access virtual tables, file-system hooks, backups, and tracing.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, apsw",
      "display": "Includes awaitable connection operations",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, apsw",
      "display": "Use async mode to await SQLite work on dedicated connection threads.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations lead, apsw",
      "display": "Shared connections serialize database work",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations, apsw",
      "display": "Use multiple connections when database operations need concurrency.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, apsw",
      "display": "Mixed SQLite builds need care",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, apsw",
      "display": "On non-Windows systems, avoid mixing SQLite builds on one database in one process.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, apsw",
      "display": "import apsw\ncon=apsw.Connection(\":memory:\")\ncur=con.cursor()\nfor row in cur.execute(\"create table foo(x,y,z);insert into foo values (?,?,?);\"\n                       \"insert into foo values(?,?,?);select * from foo;drop table foo;\"\n                       \"create table bar(x,y);insert into bar values(?,?);\"\n                       \"insert into bar values(?,?);select * from bar;\",\n                       (1,2,3,4,5,6,7,8,9,10)):\n                           print (row)\n\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, apsw",
      "display": "def _backup_database(self, path: str, name: str, extra_sql: str = '', num_of_retries: int = 10, busy_timeout: float = 60) -> None:\n    for retry_count in range(num_of_retries):\n        try:\n            with closing(apsw.Connection(path)) as dest_db:\n                with dest_db.backup('main', self.conn, name) as b:\n                    busy_since = None\n                    while not b.done:\n                        try:\n                            b.step(128)\n                        except apsw.BusyError as e:\n                            # Locks on some filesystems such as SMB/CIFS\n                            # shares never succeed, so dont retry forever\n                            now = time.monotonic()\n                            if busy_since is None:\n                                busy_since = now\n                            elif now - busy_since > busy_timeout:\n                                raise apsw.BusyError(\n                                    f'Could not lock the database at {path} for {busy_timeout} seconds.'\n                                    ' The filesystem it is on probably does not support file locking.'\n                                ) from e\n                            time.sleep(0.05)\n                        else:\n                            busy_since = None\n                if extra_sql:\n                    dest_db.cursor().execute(extra_sql)\n            return\n        except apsw.IOError as e:\n            # backup step() can fail transiently, either with\n            # SQLITE_IOERR_SHORT_READ when the source database is modified\n            # while it is being read, or with a plain SQLITE_IOERR and no\n            # error message set on the connection, which apsw reports as\n            # \"not an error\". Once step() fails the backup object is dead,\n            # so restart the entire backup. Any other extended result code\n            # is a genuine I/O error, and is not retried.\n            if retry_count >= num_of_retries - 1 or getattr(e, 'extendedresult', None) not in (apsw.SQLITE_IOERR, apsw.SQLITE_IOERR_SHORT_READ):\n                raise\n            with suppress(OSError):\n                os.remove(path)\n            time.sleep(0.2)\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, apsw",
      "display": "backend.py · _backup_database()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, apsw",
      "display": "kovidgoyal/calibre",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, kovidgoyal/calibre",
      "display": "26.5K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, kovidgoyal/calibre",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F52": {
      "label": "Library name, sqlite-utils",
      "display": "sqlite-utils",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, sqlite-utils",
      "display": "1.1M",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "License, sqlite-utils",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, sqlite-utils",
      "display": "4.2.1, Aug 2026",
      "asOf": "2026-08-13"
    },
    "F56": {
      "label": "Package release date, sqlite-utils",
      "display": "Aug 2026",
      "asOf": "2026-08-13"
    },
    "F57": {
      "label": "Repository stars, sqlite-utils",
      "display": "2.2K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "SQL functions, sqlite-utils",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Bulk inserts, sqlite-utils",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Install, sqlite-utils",
      "display": "pip install sqlite-utils",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "What it does, sqlite-utils",
      "display": "Provides Python APIs and command-line tools for manipulating SQLite data and schemas.",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths lead, sqlite-utils",
      "display": "Creates tables when inserting records",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths, sqlite-utils",
      "display": "Insert dictionaries without separately declaring the table first.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, sqlite-utils",
      "display": "Registers Python SQL functions",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, sqlite-utils",
      "display": "Register a Python function for use inside SQL queries.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "limitations lead, sqlite-utils",
      "display": "Write calls commit separately",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations, sqlite-utils",
      "display": "Use db.atomic when several writes must succeed or fail together.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Quickstart, sqlite-utils",
      "display": "from sqlite_utils import Database\n\ndb = Database(\"chickens.db\")\ndb.table(\"chickens\").insert_all([{\n    \"name\": \"Azi\",\n    \"color\": \"blue\",\n}, {\n    \"name\": \"Lila\",\n    \"color\": \"blue\",\n}, {\n    \"name\": \"Suna\",\n    \"color\": \"gold\",\n}, {\n    \"name\": \"Cardi\",\n    \"color\": \"black\",\n}])\n\n\nfor row in db.table(\"chickens\").rows:\n    print(row)\n\n\nfor row in db.query(\"\"\"\n    select color, count(*)\n    from chickens group by color\n    order by count(*) desc\n\"\"\"):\n    print(row)\n\n",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project function, sqlite-utils",
      "display": "@migration\ndef m014_schemas(db):\n    db[\"schemas\"].create(\n        {\n            \"id\": str,\n            \"content\": str,\n        },\n        pk=\"id\",\n    )\n    db[\"responses\"].add_column(\"schema_id\", str, fk=\"schemas\", fk_col=\"id\")\n    # Clean up SQL create table indentation\n    db[\"responses\"].transform()\n    # These changes may have dropped the FTS configuration, fix that\n    db[\"responses\"].enable_fts(\n        [\"prompt\", \"response\"], create_triggers=True, replace=True\n    )\n",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Project function reference, sqlite-utils",
      "display": "migrations.py · m014_schemas()",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project repository, sqlite-utils",
      "display": "simonw/llm",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project stars, simonw/llm",
      "display": "12.8K",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project push date, simonw/llm",
      "display": "Nov 2026",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Library name, sqlite3",
      "display": "sqlite3",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Monthly downloads, sqlite3",
      "display": "Standard library",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "License, sqlite3",
      "display": "PSF License Version 2",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Package release, sqlite3",
      "display": "With Python",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Undated package release, sqlite3",
      "display": "With Python",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Repository context, sqlite3",
      "display": "Part of Python",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Online backups, sqlite3",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "SQL functions, sqlite3",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Bulk inserts, sqlite3",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "Install, sqlite3",
      "display": "Bundled with Python",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "What it does, sqlite3",
      "display": "Provides Python’s standard-library interface to the SQLite database engine.",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths lead, sqlite3",
      "display": "Uses Python’s standard-library interface",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths, sqlite3",
      "display": "Access SQLite through Python’s standard-library interface when included in the interpreter build.",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths lead, sqlite3",
      "display": "Backs up active databases",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "strengths, sqlite3",
      "display": "Copy a database while other clients continue using it.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "limitations lead, sqlite3",
      "display": "Transaction contexts leave connections open",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations, sqlite3",
      "display": "Close the connection separately after its transaction context finishes.",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "Quickstart, sqlite3",
      "display": "import sqlite3\n\ncon = sqlite3.connect(\":memory:\")\ncon.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR UNIQUE)\")\n\n# Successful, con.commit() is called automatically afterwards\nwith con:\n    con.execute(\"INSERT INTO lang(name) VALUES(?)\", (\"Python\",))\n\n# con.rollback() is called after the with block finishes with an exception,\n# the exception is still raised and must be caught\ntry:\n    with con:\n        con.execute(\"INSERT INTO lang(name) VALUES(?)\", (\"Python\",))\nexcept sqlite3.IntegrityError:\n    print(\"couldn't add Python twice\")\n\n# Connection object used as context manager only commits or rollbacks transactions,\n# so the connection object should be closed manually\ncon.close()\n\n",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Quickstart source reference, sqlite3",
      "display": "sqlite3.html",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project function, sqlite3",
      "display": "def setup(self) -> None:\n    \"\"\"Set up the checkpoint database.\n\n    This method creates the necessary tables in the SQLite database if they don't\n    already exist. It is called automatically when needed and should not be called\n    directly by the user.\n    \"\"\"\n    if self.is_setup:\n        return\n\n    self.conn.executescript(\n        \"\"\"\n        PRAGMA journal_mode=WAL;\n        CREATE TABLE IF NOT EXISTS checkpoints (\n            thread_id TEXT NOT NULL,\n            checkpoint_ns TEXT NOT NULL DEFAULT '',\n            checkpoint_id TEXT NOT NULL,\n            parent_checkpoint_id TEXT,\n            type TEXT,\n            checkpoint BLOB,\n            metadata BLOB,\n            PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)\n        );\n        CREATE TABLE IF NOT EXISTS writes (\n            thread_id TEXT NOT NULL,\n            checkpoint_ns TEXT NOT NULL DEFAULT '',\n            checkpoint_id TEXT NOT NULL,\n            task_id TEXT NOT NULL,\n            task_path TEXT NOT NULL DEFAULT '',\n            idx INTEGER NOT NULL,\n            channel TEXT NOT NULL,\n            type TEXT,\n            value BLOB,\n            PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id, task_id, idx)\n        );\n        \"\"\"\n    )\n    # sqlite has no ADD COLUMN IF NOT EXISTS; this migrates databases\n    # created before `task_path` existed and is a no-op on the rest.\n    try:\n        self.conn.execute(\n            \"ALTER TABLE writes ADD COLUMN task_path TEXT NOT NULL DEFAULT ''\"\n        )\n    except sqlite3.OperationalError as e:\n        # A read-only database from before the column can still be read;\n        # its rows would all read back as '' anyway.\n        if \"readonly database\" in str(e):\n            self._has_task_path = False\n        elif \"duplicate column name\" not in str(e):\n            raise\n\n    self.is_setup = True\n",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project function reference, sqlite3",
      "display": "__init__.py · setup()",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Project repository, sqlite3",
      "display": "langchain-ai/langgraph",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project stars, langchain-ai/langgraph",
      "display": "45.0K",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project push date, langchain-ai/langgraph",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F98": {
      "label": "Developer need",
      "display": "Bundled SQL access",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose sqlite3",
      "display": "the standard-library SQLite interface",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "bundled SQL access",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "When to consider apsw",
      "display": "SQLite-specific extension control matters",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "SQLite-specific extension control",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose apsw",
      "display": "virtual tables, backups, and tracing APIs",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "SQLite-specific extension control",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Developer need",
      "display": "Record-shaped inserts",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Why choose sqlite-utils",
      "display": "table creation when inserting records",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Developer need in introduction",
      "display": "record-shaped inserts",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "When to consider peewee",
      "display": "declared related models fit the application",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Developer need",
      "display": "Related model classes",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Why choose peewee",
      "display": "fields and foreign keys mapped to tables",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Developer need in introduction",
      "display": "related model classes",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Page introduction",
      "display": "Python SQLite libraries let application developers store and query application data.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Which SQLite interface comes with Python?",
      "display": "sqlite3 exposes SQLite through the standard library.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Which SQLite interface comes with Python?",
      "display": "The standard library is distributed with Python.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Does a sqlite3 transaction context close its connection?",
      "display": "The context manager neither opens a transaction implicitly nor closes the connection; close it separately.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Can sqlite3 back up a database that is in use?",
      "display": "Its backup API works while other clients or the same connection concurrently access the database.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does current APSW support async applications?",
      "display": "Current APSW provides built-in async operation across its functionality.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does current APSW support async applications?",
      "display": "Database operations run on a dedicated worker thread per connection and can be awaited.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Does sharing one APSW connection increase concurrent database work?",
      "display": "The connection mutex serializes calls; multiple connections are needed for database concurrency.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Is it safe to mix different SQLite libraries on one database?",
      "display": "APSW warns against opening the same database with two different SQLite libraries in one process on non-Windows platforms.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Does sqlite-utils need a separate commit after inserting records?",
      "display": "Its write methods commit their own changes before returning.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Does sqlite-utils need a separate commit after inserting records?",
      "display": "Use db.atomic to group several method calls into one unit of work.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Can sqlite-utils create a table from inserted dictionaries?",
      "display": "An absent table is created when data is first inserted or upserted.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can Python functions run inside SQL expressions?",
      "display": "sqlite3 supports user-defined SQL functions.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Can Python functions run inside SQL expressions?",
      "display": "sqlite-utils registers Python SQL callbacks through db.register_function.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: What driver does Peewee need for async SQLite?",
      "display": "Peewee’s async backends use standard drivers; the SQLite driver is aiosqlite.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does Peewee pool several connections for an in-memory async database?",
      "display": "Its in-memory async database always uses one connection regardless of pool_size.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: What does CSV output in this comparison mean?",
      "display": "sqlite-utils can return CLI query results as CSV through --csv.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "Library name, sqlalchemy",
      "display": "SQLAlchemy",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Monthly downloads, sqlalchemy",
      "display": "417.4M",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "License, sqlalchemy",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Package release, sqlalchemy",
      "display": "2.1.9",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Package release date, sqlalchemy",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Install, sqlalchemy",
      "display": "pip install SQLAlchemy",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Quickstart, sqlalchemy",
      "display": "from sqlalchemy import create_engine, text\nengine = create_engine(\"sqlite+pysqlite:///:memory:\")\nwith engine.connect() as connection:\n    print(connection.execute(text(\"SELECT 1\")).scalar())\n",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Official description, sqlalchemy",
      "display": "Provides a database abstraction library.",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Quickstart source file, sqlalchemy",
      "display": "tutorial/dbapi_transactions.html",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Repository stars, sqlalchemy",
      "display": "12.3K",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "ORM model classes, sqlalchemy",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "AsyncIO query interface, sqlalchemy",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Access and engine role, sqlalchemy",
      "display": "SQLite dialect in a portable Core/ORM toolkit; explicit engine, transaction, expression, and mapped-model interfaces.",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project prerequisites and behavior, sqlalchemy",
      "display": "Whole seven-line begin_sqlite_stmt callback receives an actual sqlalchemy.Connection; current2.1 exec_driver_sql accepts its SQL string and returns a CursorResult which is intentionally unused. Same-file event setup binds this callback to the SQLite engine begin event, and begin_transaction sets only IMMEDIATE or DEFERRED, valid SQLite BEGIN modes. ContextVar.get is host state, not a native SDK call. Requires the original paired driver-autobegin suppression and original event registration. This is callback-scoped API compatibility, not certification of every enclosing historical Prefect async-dialect annotation or a full application migration.",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project function, sqlalchemy",
      "display": "def begin_sqlite_stmt(self, conn: sa.Connection) -> None:\n    # emit our own BEGIN\n    # requires `begin_sqlite_conn`\n    # see https://docs.sqlalchemy.org/en/20/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl\n    mode = SQLITE_BEGIN_MODE.get()\n    if mode is not None:\n        conn.exec_driver_sql(f\"BEGIN {mode}\")\n",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project source file, sqlalchemy",
      "display": "src/prefect/server/database/configurations.py",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project full_name, sqlalchemy",
      "display": "PrefectHQ/prefect",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Project stargazers_count, sqlalchemy",
      "display": "24.2K",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Library name, aiosqlite",
      "display": "aiosqlite",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Monthly downloads, aiosqlite",
      "display": "74.3M",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "License, aiosqlite",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Package release, aiosqlite",
      "display": "0.22.1",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Package release date, aiosqlite",
      "display": "Dec 2025",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Install, aiosqlite",
      "display": "pip install aiosqlite",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Quickstart, aiosqlite",
      "display": "import asyncio\nimport aiosqlite\nasync def main():\n    async with aiosqlite.connect(\":memory:\") as db:\n        async with db.execute(\"SELECT 1\") as cursor:\n            print(await cursor.fetchone())\nasyncio.run(main())\n",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Official description, aiosqlite",
      "display": "Bridges asyncio code to the standard sqlite3 module.",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Quickstart source file, aiosqlite",
      "display": "index.html",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Repository stars, aiosqlite",
      "display": "1.6K",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "ORM model classes, aiosqlite",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "AsyncIO query interface, aiosqlite",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Access and engine role, aiosqlite",
      "display": "AsyncIO wrapper around SQLite DB-API work, with one shared worker thread/request queue per connection.",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project prerequisites and behavior, aiosqlite",
      "display": "Whole original AsyncSqliteSaver.setup uses its real aiosqlite.Connection, obtained in from_conn_string through async with aiosqlite.connect. Current0.22 Connection.executescript returns an asynchronous cursor context manager; commit and execute are awaitable. Text DDL/PRAGMA and an empty parameter list are supported, and OperationalError is the driver exception. The returned execute cursor is not consumed. The original lock, is_setup guard, schema strings, and read-only/duplicate-column exception branches are preserved; no checkpointing or database code was run.",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project function, aiosqlite",
      "display": "async def setup(self) -> None:\n    \"\"\"Set up the checkpoint database asynchronously.\n\n    This method creates the necessary tables in the SQLite database if they don't\n    already exist. It is called automatically when needed and should not be called\n    directly by the user.\n    \"\"\"\n    async with self.lock:\n        if self.is_setup:\n            return\n        await _ensure_connected(self.conn)\n        async with self.conn.executescript(\n            \"\"\"\n            PRAGMA journal_mode=WAL;\n            CREATE TABLE IF NOT EXISTS checkpoints (\n                thread_id TEXT NOT NULL,\n                checkpoint_ns TEXT NOT NULL DEFAULT '',\n                checkpoint_id TEXT NOT NULL,\n                parent_checkpoint_id TEXT,\n                type TEXT,\n                checkpoint BLOB,\n                metadata BLOB,\n                PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)\n            );\n            CREATE TABLE IF NOT EXISTS writes (\n                thread_id TEXT NOT NULL,\n                checkpoint_ns TEXT NOT NULL DEFAULT '',\n                checkpoint_id TEXT NOT NULL,\n                task_id TEXT NOT NULL,\n                task_path TEXT NOT NULL DEFAULT '',\n                idx INTEGER NOT NULL,\n                channel TEXT NOT NULL,\n                type TEXT,\n                value BLOB,\n                PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id, task_id, idx)\n            );\n            \"\"\"\n        ):\n            await self.conn.commit()\n\n        # sqlite has no ADD COLUMN IF NOT EXISTS; this migrates databases\n        # created before `task_path` existed and is a no-op on the rest.\n        try:\n            await self.conn.execute(\n                \"ALTER TABLE writes ADD COLUMN task_path TEXT NOT NULL DEFAULT ''\"\n            )\n            await self.conn.commit()\n        except aiosqlite.OperationalError as e:\n            # A read-only database from before the column can still be read;\n            # its rows would all read back as '' anyway.\n            if \"readonly database\" in str(e):\n                self._has_task_path = False\n            elif \"duplicate column name\" not in str(e):\n                raise\n\n        self.is_setup = True\n",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project source file, aiosqlite",
      "display": "libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Project full_name, aiosqlite",
      "display": "langchain-ai/langgraph",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Project stargazers_count, aiosqlite",
      "display": "45.1K",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Library name, peewee",
      "display": "Peewee",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Monthly downloads, peewee",
      "display": "42.4M",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "License, peewee",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Package release, peewee",
      "display": "4.5.3",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Package release date, peewee",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Install, peewee",
      "display": "pip install peewee",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Quickstart, peewee",
      "display": "from peewee import SqliteDatabase\ndb = SqliteDatabase(\":memory:\")\nprint(db.execute_sql(\"SELECT 1\").fetchone())\ndb.close()\n",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Repository stars, peewee",
      "display": "12.0K",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "ORM model classes, peewee",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "AsyncIO query interface, peewee",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Access and engine role, peewee",
      "display": "Compact model/query ORM with SQLite database helpers and a separate asyncio API using an async driver.",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Project prerequisites and behavior, peewee",
      "display": "Whole original initialize_dataset constructs Peewee SqliteDatabase with a filename or file: URI plus uri=True, explicitly connects/closes for read-only validation, configures pragma(...,permanent=True), and loads extension names. Current4.5 documents those methods and filename/connection kwargs. Actual host SqliteDataSet subclasses playhouse.dataset.DataSet; its current constructor accepts the Database object and include_views, and update_cache/close remain supported by that native class. ensure_cache is host code, not an extra native operation. Requires original dataset_config, supported SQLite extension binaries, and readable filename; the source read-only failure intentionally exits through host die().",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Project function, peewee",
      "display": "def initialize_dataset(filename):\n    dataset_kw = {}\n    if peewee_version >= (3, 14, 9):\n        dataset_kw['include_views'] = True\n\n    if dataset_config['read_only']:\n        if peewee_version < (3, 5, 1):\n            die('Peewee 3.5.1 or newer is required for read-only access.')\n        db = SqliteDatabase('file:%s?mode=ro' % filename, uri=True)\n        try:\n            db.connect()\n        except OperationalError:\n            die('Unable to open database file in read-only mode. Ensure that '\n                'the database exists in order to use read-only mode.')\n        db.close()\n    else:\n        db = SqliteDatabase(filename)\n\n    if dataset_config['foreign_keys']:\n        db.pragma('foreign_keys', True, permanent=True)\n\n    if dataset_config['extensions']:\n        # Load extensions before performing introspection.\n        for ext in dataset_config['extensions']:\n            db.load_extension(ext)\n\n    if dataset_config['startup_hook']:\n        dataset_config['startup_hook'](db)\n\n    dataset = SqliteDataSet(db, **dataset_kw)\n    dataset.ensure_cache()\n    dataset.close()\n    return dataset\n",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project source file, peewee",
      "display": "sqlite_web/sqlite_web.py",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project full_name, peewee",
      "display": "coleifer/sqlite-web",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project stargazers_count, peewee",
      "display": "4.2K",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Library name, sqlmodel",
      "display": "SQLModel",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Monthly downloads, sqlmodel",
      "display": "28.1M",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "License, sqlmodel",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Package release, sqlmodel",
      "display": "0.0.50",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Package release date, sqlmodel",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Install, sqlmodel",
      "display": "pip install sqlmodel",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Quickstart, sqlmodel",
      "display": "from sqlmodel import Field, Session, SQLModel, create_engine, select\nclass Hero(SQLModel, table=True):\n    id: int | None = Field(default=None, primary_key=True)\n    name: str\nengine = create_engine(\"sqlite:///:memory:\")\nSQLModel.metadata.create_all(engine)\nwith Session(engine) as session:\n    print(session.exec(select(Hero)).all())\n",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Official description, sqlmodel",
      "display": "Works with SQL databases in Python.",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Quickstart source file, sqlmodel",
      "display": "tutorial/select/",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Repository stars, sqlmodel",
      "display": "18.6K",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "ORM model classes, sqlmodel",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "AsyncIO query interface, sqlmodel",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Access and engine role, sqlmodel",
      "display": "Pydantic-backed model classes and SQLAlchemy interoperability, with a dedicated Session.exec scalar-result interface.",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Project prerequisites and behavior, sqlmodel",
      "display": "Whole original FastAPI read_heroes route imports native SQLModel Session and select, executes select(Hero).offset(offset).limit(limit), and consumes ScalarResult.all. Current0.0.50 Session.exec explicitly converts a SelectOfScalar into ScalarResult through results.scalars(); the official select tutorial documents this exact exec(...).all workflow and pagination. The same original file creates sqlite:///database.db and injects Session(engine), proving the SQLite backend. Offset/limit/all are SQLAlchemy expression/result peer APIs; they are not falsely counted as additional independent SQLModel calls. Actual FastAPI Query/decorator and Hero table definitions are original host prerequisites; no server ran.",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Project function, sqlmodel",
      "display": "@app.get(\"/heroes/\")\ndef read_heroes(\n    session: SessionDep,\n    offset: int = 0,\n    limit: Annotated[int, Query(le=100)] = 100,\n) -> list[Hero]:\n    heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()\n    return heroes\n",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Project source file, sqlmodel",
      "display": "docs_src/sql_databases/tutorial001.py",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Project full_name, sqlmodel",
      "display": "fastapi/fastapi",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Project stargazers_count, sqlmodel",
      "display": "104.8K",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Library name, apsw",
      "display": "APSW",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Monthly downloads, apsw",
      "display": "2.6M",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "License, apsw",
      "display": "any-OSI",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Package release, apsw",
      "display": "3.54.1.0",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Package release date, apsw",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Install, apsw",
      "display": "pip install apsw",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Quickstart, apsw",
      "display": "import apsw\nwith apsw.Connection(\":memory:\") as connection:\n    print(connection.execute(\"SELECT 1\").fetchone())\n",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Repository stars, apsw",
      "display": "955",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "ORM model classes, apsw",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "AsyncIO query interface, apsw",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Access and engine role, apsw",
      "display": "Direct SQLite C API access, including incremental backups, controller-based async connections, and explicit native error/result codes.",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Project prerequisites and behavior, apsw",
      "display": "Whole original Calibre _backup_database creates an APSW destination Connection, opens backup(destination main,source connection,source database name), reads Backup.done, and calls step(128) until complete. The current3.54 backup context manager finalizes its handle; contextlib.closing closes the destination. Optional extra_sql goes through a current Cursor.execute. BusyError and IOError/extendedresult plus SQLITE_IOERR and SQLITE_IOERR_SHORT_READ are current documented error contracts. The same original file defines self.conn as a property constructing a subclass of apsw.Connection, proving the source receiver; host extension loading is outside this selected backup function and is not certified as a full Calibre upgrade. Requires a valid original connection/database name and writable destination; retry and file deletion behavior remain intact.",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Project function, apsw",
      "display": "def _backup_database(self, path: str, name: str, extra_sql: str = '', num_of_retries: int = 10, busy_timeout: float = 60) -> None:\n    for retry_count in range(num_of_retries):\n        try:\n            with closing(apsw.Connection(path)) as dest_db:\n                with dest_db.backup('main', self.conn, name) as b:\n                    busy_since = None\n                    while not b.done:\n                        try:\n                            b.step(128)\n                        except apsw.BusyError as e:\n                            # Locks on some filesystems such as SMB/CIFS\n                            # shares never succeed, so dont retry forever\n                            now = time.monotonic()\n                            if busy_since is None:\n                                busy_since = now\n                            elif now - busy_since > busy_timeout:\n                                raise apsw.BusyError(\n                                    f'Could not lock the database at {path} for {busy_timeout} seconds.'\n                                    ' The filesystem it is on probably does not support file locking.'\n                                ) from e\n                            time.sleep(0.05)\n                        else:\n                            busy_since = None\n                if extra_sql:\n                    dest_db.cursor().execute(extra_sql)\n            return\n        except apsw.IOError as e:\n            # backup step() can fail transiently, either with\n            # SQLITE_IOERR_SHORT_READ when the source database is modified\n            # while it is being read, or with a plain SQLITE_IOERR and no\n            # error message set on the connection, which apsw reports as\n            # \"not an error\". Once step() fails the backup object is dead,\n            # so restart the entire backup. Any other extended result code\n            # is a genuine I/O error, and is not retried.\n            if retry_count >= num_of_retries - 1 or getattr(e, 'extendedresult', None) not in (apsw.SQLITE_IOERR, apsw.SQLITE_IOERR_SHORT_READ):\n                raise\n            with suppress(OSError):\n                os.remove(path)\n            time.sleep(0.2)\n",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Project source file, apsw",
      "display": "src/calibre/db/backend.py",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Project full_name, apsw",
      "display": "kovidgoyal/calibre",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Project stargazers_count, apsw",
      "display": "26.5K",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Library name, sqlite-utils",
      "display": "sqlite-utils",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Monthly downloads, sqlite-utils",
      "display": "1.1M",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "License, sqlite-utils",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Package release, sqlite-utils",
      "display": "4.2.1",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Package release date, sqlite-utils",
      "display": "Aug 2026",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Install, sqlite-utils",
      "display": "pip install sqlite-utils",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Quickstart, sqlite-utils",
      "display": "from sqlite_utils import Database\ndb = Database(memory=True)\nprint(db.execute(\"SELECT 1\").fetchone())\n",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Repository stars, sqlite-utils",
      "display": "2.2K",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "ORM model classes, sqlite-utils",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "AsyncIO query interface, sqlite-utils",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Access and engine role, sqlite-utils",
      "display": "Schema/table transformations and Python dictionary/list record workflows over an existing or newly opened SQLite database.",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Project prerequisites and behavior, sqlite-utils",
      "display": "Whole original m014_schemas migration invokes real sqlite_utils Database table interfaces. Current4.2 create accepts a Python type mapping and pk; add_column accepts str with fk/fk_col; transform has default arguments; enable_fts accepts column-name list plus create_triggers and replace. Table-producing db[name] ownership is the SDK documented interface. Requires the pre-existing responses table and prompt/response columns, plus available FTS implementation; the original migration dispatcher creates/passes sqlite_utils.Database. No migration/schema/FTS code ran.",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Project function, sqlite-utils",
      "display": "@migration\ndef m014_schemas(db):\n    db[\"schemas\"].create(\n        {\n            \"id\": str,\n            \"content\": str,\n        },\n        pk=\"id\",\n    )\n    db[\"responses\"].add_column(\"schema_id\", str, fk=\"schemas\", fk_col=\"id\")\n    # Clean up SQL create table indentation\n    db[\"responses\"].transform()\n    # These changes may have dropped the FTS configuration, fix that\n    db[\"responses\"].enable_fts(\n        [\"prompt\", \"response\"], create_triggers=True, replace=True\n    )\n",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Project source file, sqlite-utils",
      "display": "llm/migrations.py",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Project full_name, sqlite-utils",
      "display": "simonw/llm",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Project stargazers_count, sqlite-utils",
      "display": "12.8K",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Library name, pysqlite3-binary",
      "display": "pysqlite3-binary",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Monthly downloads, pysqlite3-binary",
      "display": "798.1K",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "License, pysqlite3-binary",
      "display": "zlib/libpng",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Package release, pysqlite3-binary",
      "display": "0.5.4.post2",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Package release date, pysqlite3-binary",
      "display": "Dec 2025",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Install, pysqlite3-binary",
      "display": "pip install pysqlite3-binary",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Quickstart, pysqlite3-binary",
      "display": "from pysqlite3 import dbapi2\nconnection = dbapi2.connect(\":memory:\")\nconnection.execute(\"CREATE TABLE demo (id INTEGER PRIMARY KEY)\")\nconnection.close()\n",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Official description, pysqlite3-binary",
      "display": "Implements the DB-API interface for SQLite.",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Quickstart source file, pysqlite3-binary",
      "display": "pysqlite3/dbapi2.py",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Repository stars, pysqlite3-binary",
      "display": "246",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "ORM model classes, pysqlite3-binary",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "AsyncIO query interface, pysqlite3-binary",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Access and engine role, pysqlite3-binary",
      "display": "Prebuilt alternative pysqlite3 DB-API distribution with bundled SQLite; import/runtime identity differs from its PyPI distribution name.",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Project prerequisites and behavior, pysqlite3-binary",
      "display": "Whole original sqlite-utils Database.__init__ is reviewed specifically for runtime with the selected pysqlite3-binary distribution installed and new filename/memory branches. Actual utils.py dynamically imports pysqlite3 and pysqlite3.dbapi2 outside TYPE_CHECKING, falling back to stdlib only when unavailable; db.py imports that binding. Four native connect call sites are alternative branches, not four connections per invocation. Current native connection constructor supports database, uri=True, and check_same_thread=False, and returns Connection, also supporting the source Connection annotation/type cast. Existing supplied connections may be another driver and are not claimed as pysqlite3 usage. getattr guards for optional autocommit/constants are intentionally preserved. Host execute/plugin callbacks are not counted as pysqlite3 calls. This is wrapper-construction usage, not task-specific driver adoption or a runnable isolated function.",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Project function, pysqlite3-binary",
      "display": "def __init__(\n    self,\n    filename_or_conn: str | pathlib.Path | sqlite3.Connection | None = None,\n    memory: bool = False,\n    memory_name: str | None = None,\n    recreate: bool = False,\n    recursive_triggers: bool = True,\n    tracer: Tracer | None = None,\n    use_counts_table: bool = False,\n    execute_plugins: bool = True,\n    use_old_upsert: bool = False,\n    strict: bool = False,\n):\n    self.memory_name = None\n    self.memory = False\n    self.use_old_upsert = use_old_upsert\n    if not (\n        (filename_or_conn is not None and (not memory and not memory_name))\n        or (filename_or_conn is None and (memory or memory_name))\n    ):\n        raise ValueError(\"Either specify a filename_or_conn or pass memory=True\")\n    if memory_name:\n        uri = f\"file:{memory_name}?mode=memory&cache=shared\"\n        self.conn = sqlite3.connect(\n            uri,\n            uri=True,\n            check_same_thread=False,\n        )\n        self.memory = True\n        self.memory_name = memory_name\n    elif memory or filename_or_conn == \":memory:\":\n        self.conn = sqlite3.connect(\":memory:\")\n        self.memory = True\n    elif isinstance(filename_or_conn, (str, pathlib.Path)):\n        if recreate and os.path.exists(filename_or_conn):\n            try:\n                os.remove(filename_or_conn)\n            except OSError:\n                # Avoid mypy and __repr__ errors, see:\n                # https://github.com/simonw/sqlite-utils/issues/503\n                self.conn = sqlite3.connect(\":memory:\")\n                raise\n        self.conn = sqlite3.connect(str(filename_or_conn))\n    else:\n        if recreate:\n            raise ValueError(\"recreate cannot be used with connections, only paths\")\n        self.conn = cast(sqlite3.Connection, filename_or_conn)\n        # Python 3.12+ autocommit=True/False connections make commit()\n        # and rollback() behave differently, silently breaking the\n        # transaction handling used by every write method\n        autocommit = getattr(self.conn, \"autocommit\", None)\n        if autocommit is not None and autocommit != getattr(\n            sqlite3, \"LEGACY_TRANSACTION_CONTROL\", -1\n        ):\n            raise TransactionError(\n                \"sqlite-utils requires a connection that uses the default \"\n                \"transaction handling - connections created with \"\n                \"autocommit=True or autocommit=False are not supported\"\n            )\n    self._tracer: Tracer | None = tracer\n    if recursive_triggers:\n        self.execute(\"PRAGMA recursive_triggers=on;\")\n    self._registered_functions: set = set()\n    self.use_counts_table = use_counts_table\n    if execute_plugins:\n        ensure_plugins_loaded()\n        pm.hook.prepare_connection(conn=self.conn)\n    self.strict = strict\n",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Project source file, pysqlite3-binary",
      "display": "sqlite_utils/db.py",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Project full_name, pysqlite3-binary",
      "display": "simonw/sqlite-utils",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Project stargazers_count, pysqlite3-binary",
      "display": "2.2K",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Library name, sqlcipher3",
      "display": "sqlcipher3",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Monthly downloads, sqlcipher3",
      "display": "465.6K",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "License, sqlcipher3",
      "display": "Zlib",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Package release, sqlcipher3",
      "display": "0.6.5",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Package release date, sqlcipher3",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Install, sqlcipher3",
      "display": "pip install sqlcipher3",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Quickstart, sqlcipher3",
      "display": "from sqlcipher3 import dbapi2\nconnection = dbapi2.connect(\":memory:\")\nconnection.execute(\"PRAGMA key='replace-with-a-secret'\")\nconnection.execute(\"CREATE TABLE demo (id INTEGER PRIMARY KEY)\")\nconnection.close()\n",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Official description, sqlcipher3",
      "display": "Implements the DB-API interface for SQLCipher.",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Quickstart source file, sqlcipher3",
      "display": "sqlcipher3/dbapi2.py",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Repository stars, sqlcipher3",
      "display": "127",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "ORM model classes, sqlcipher3",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "AsyncIO query interface, sqlcipher3",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Access and engine role, sqlcipher3",
      "display": "DB-API wrapper around SQLCipher; keyed encrypted SQLite databases require SQLCipher runtime/build support and explicit key setup.",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Project prerequisites and behavior, sqlcipher3",
      "display": "Whole original Peewee _SqlCipherDatabase._connect imports sqlcipher3.dbapi2 as sqlcipher, opens the database with isolation_level=None and actual host connect_params, optionally issues escaped PRAGMA key, and closes the native Connection on a setup failure. Current0.6.5 native connect supports database/isolation_level and documented DB-API keywords; execute accepts SQL and close releases the connection. Scope assumes connect_params are valid driver kwargs as required by the original adapter, not arbitrary accepted options. A nonempty passphrase is necessary to activate the shown key path; an empty passphrase is not claimed encrypted. _add_conn_hooks is original ORM host setup, not another native SQLCipher operation. No key, DB, or SDK was executed.",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "Project function, sqlcipher3",
      "display": "def _connect(self):\n    params = dict(self.connect_params)\n    passphrase = params.pop('passphrase', '').replace(\"'\", \"''\")\n\n    conn = sqlcipher.connect(self.database, isolation_level=None, **params)\n    try:\n        if passphrase:\n            conn.execute(\"PRAGMA key='%s'\" % passphrase)\n        self._add_conn_hooks(conn)\n    except:\n        conn.close()\n        raise\n    return conn\n",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Project source file, sqlcipher3",
      "display": "playhouse/sqlcipher_ext.py",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Project full_name, sqlcipher3",
      "display": "coleifer/peewee",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Project stargazers_count, sqlcipher3",
      "display": "12.0K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python SQLite libraries sqlite3 APSW sqlite-utils Peewee code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
