Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pydapper to database drivers #108

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zschumacher
Copy link

@zschumacher zschumacher commented Apr 4, 2023

What is this project?

A micro ORM that provides more convenient methods for working with databases in python. Has both sync and async apis for multiple databases, see example below:

import asyncio
import datetime
from dataclasses import dataclass

from pydapper import connect_async


@dataclass
class Task:
    id: int
    description: str
    due_date: datetime.date
    owner_id: int


async def main():
    async with connect_async() as commands:
        data = await commands.query_async("select * from task limit 1", model=Task)

https://pydapper.readthedocs.io/en/latest/

Why is it awesome?

  • Provides a consistent interface for multiple dbapis
  • Provides a consistent way to bind parameters across dbapis
  • Uses SQL as the query language instead of an ORM-like API
  • Provides lightweight object mapping to any object type, but typically used with pydantic, dataclasses, or dictionaries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant