{"repo":"dialoguemd/fastapi-sqla","free":true,"listed":false,"github":"https://github.com/dialoguemd/fastapi-sqla","clone":"git clone https://github.com/dialoguemd/fastapi-sqla.git","description":"SQLAlchemy extension for FastAPI with support for pagination, asyncio, SQLModel and pytest, ready for production.","language":"Python","stars":449,"topics":["fastapi","fastapi-sqlalchemy","sqlalchemy","fastapi-sqla","library"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Fastapi-SQLA Fastapi-SQLA is an [SQLAlchemy] extension for [FastAPI] easy to setup with support for pagination, asyncio, [SQLModel] and [pytest]. It supports SQLAlchemy =1.3 and is fully compliant with [SQLAlchemy 2.0]. It is developped, maintained and used on production by the team at [@dialoguemd] with love from Montreal 🇨🇦. Installing Using pip: Note that you need a SQLAlchemy compatible engine adapter. We test with psycopg2 which you can install using the psycopg2 extra. Quick Example Assuming it runs against a DB with a table user with 3 columns, id , name and unique email : Creating a db using sqlite3 : Running the app: Configuration Environment variables: The keys of interest in os.environ are prefixed with sqlalchemy . Each matching key (after the prefix is stripped) is treated as though it were the corresponding keyword argument to [ sqlalchemy.create engine ] call. The only required key is sqlalchemy url , which provides the database URL, example: Multi-session support In order to configure multiple sessions for the application, set the environment variables with this prefix format: fastapi sqla MY KEY . As with the default session, each matching key (after the prefix is stripped) is treated as though it were the corresponding keyword argument to [ sqlalchemy.create engine ] call. For example, to configure a session with the read only key: asyncio support using [ asyncpg ] SQLAlchemy = 1.4 supports asyncio . To enable asyncio support against a Postgres DB, install","default_branch":null,"files":null,"tree":[],"storefront":"/r/dialoguemd","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dialoguemd/fastapi-sqla/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}