Skip to main content

A SQLAlchemy middleware for FastAPI

Project description

FastAlchemy

Build Status codecov

SQLAlchemy Middleware for FastAPI inspired by the official tutorial.

Install

pip install fastapi fastalchemy

Features

  • Super-easy configuration: simply put database.py and models.py files in your project folder with the following code.
from fastapi import FastAPI
from fastalchemy import SQLAlchemyMiddleware, db

from models import User

app = FastAPI()
app.add_middleware(SQLAlchemyMiddleware)

@app.get('/users')
def get_users():
    return db.query(User).order_by(User.id).all()

Details

Please peek tests/app folder if you want to know the way to create database.py and models py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastalchemy-0.1.3.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file fastalchemy-0.1.3.tar.gz.

File metadata

  • Download URL: fastalchemy-0.1.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.2

File hashes

Hashes for fastalchemy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 08a5b44fd0e2450c8fbc4e664d3ec3c48798e58c2410bc040a7af55aab5d5dd8
MD5 4b0fabae672bc916a05fc50dbbba8886
BLAKE2b-256 700869b96ae52b32c5ab240e55cb8f1fc3616aa30717c85618017d6e50ec64dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page