Improving the TODO app with SQLAlchemy
--------------------------------------
.. admonition:: Who is this tutorial for?
:class: info
This tutorial is aimed at developers who are already familiar with Litestar's core concepts such as route
handlers and dependency injection.
If you are new to Litestar, it is recommended to first follow the
`Developing a basic TODO application <../todo-app>`_ tutorial.
Install SQLAlchemy via Advanced Alchemy
========================================
To follow this tutorial, you will need Advanced Alchemy installed. You can install it with ``pip install advanced-alchemy[aiosqlite]'``, or let
Litestar install it for you by installing the ``sqlalchemy`` extra (e.g., ``pip install 'litestar[standard,sqlalchemy]' aiosqlite``).
.. note::
SQLAlchemy support in Litestar is now provided by `Advanced Alchemy `_,
a first-party library. All imports should use ``advanced_alchemy.extensions.litestar`` instead of the deprecated
``litestar.contrib.sqlalchemy`` or ``litestar.plugins.sqlalchemy`` modules.
What's in this tutorial?
========================
This tutorial builds on the `TODO app tutorial <../todo-app>`_ by adding a database backend using
`SQLAlchemy `_ via Advanced Alchemy.
We start by comparing a refactored TODO app that leverages SQLAlchemy for data persistence to the TODO app from the
`TODO app tutorial <../todo-app>`_.
We will then gradually improve on the design of our app by utilising more of Litestar's features, such as dependency
injection, and plugins.
Contents
========
.. toctree::
:titlesonly:
0-introduction
1-provide-session-with-di
2-serialization-plugin
3-init-plugin
4-final-touches-and-recap