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

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

Uploaded Source

File details

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

File metadata

  • Download URL: fastalchemy-0.1.2.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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.2

File hashes

Hashes for fastalchemy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2ea421e826b38f716d9740c75ccc6023e6b2bac8609a537b4a003bfc7a413112
MD5 e4a723638047c36915e207c3161d36ae
BLAKE2b-256 20a8d85c8112904054b685a0d3427816886fa0eba14887edcf3e2b4691fa0122

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