Skip to content

Example RestAPI using FastAPI and pyodbc to connect to a MSSQL Database #1408

@esundberg

Description

@esundberg

Created a sample RestAPI using FastAPI and pyodbc to connect to a MSSQL Database. Good for learning and seeing a complete example that is a 3rd party library to connect to a database.

FastAPI Examples

  • POST, GET (One and All Records), PUT, and DELETE
  • How to call a CRUD Class to interface with a database
  • Request Body parsing with pydantic for POST's and PUT's
  • How to get the raw request body using scarlette request.

Python Class to interface to the database

  • Create record
  • List all records
  • Read one record
  • Update one record
  • Delete one record

https://github.com/esundberg/FastAPI-pyodbc-mssql-example

Hope this could help someone.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions