Skip to main content

A SQLAlchemy middleware for FastAPI

Project description

FastAlchemy

Build Status codecov

SQLAlchemy Middleware for FastAPI inspired by the official tutorial.

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 SQLAlchemyMiddlware, 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.1.tar.gz (3.0 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for fastalchemy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 570a56fa9f6dada358a80c3c5dcefca9f0387a8bb6dd7062c12f355a8d424267
MD5 ff1a69c7015c0c5170ab0e1164c88697
BLAKE2b-256 020dd50b79d44dd6c5fc1a2a463b5cd14bb7b7579b76e7911c6e47d4484b9ff3

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