All Projects → CanopyTax → Asyncpgsa

CanopyTax / Asyncpgsa

Licence: apache-2.0
A wrapper around asyncpg for use with sqlalchemy

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Asyncpgsa

Databases
Async database support for Python. 🗄
Stars: ✭ 2,602 (+601.35%)
Mutual labels:  asyncio, sqlalchemy, postgres
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (-72.24%)
Mutual labels:  postgres, sqlalchemy
ChefAPI
API using FastAPI and PostgreSQL for sharing or keeping track of awesome food recipes Based on Oauth2 and JWT 💎
Stars: ✭ 16 (-95.69%)
Mutual labels:  postgres, sqlalchemy
fastapi-starter
A FastAPI based low code starter: Async SQLAlchemy, Postgres, React-Admin, pytest and cypress
Stars: ✭ 97 (-73.85%)
Mutual labels:  postgres, sqlalchemy
Gino
GINO Is Not ORM - a Python asyncio ORM on SQLAlchemy core.
Stars: ✭ 2,299 (+519.68%)
Mutual labels:  asyncio, sqlalchemy
Create Aio App
The boilerplate for aiohttp. Quick setup for your asynchronous web service.
Stars: ✭ 207 (-44.2%)
Mutual labels:  asyncio, postgres
FinanceCenter
Fetching Financial Data (US/China)
Stars: ✭ 26 (-92.99%)
Mutual labels:  sqlalchemy, asyncio
Aiopg
aiopg is a library for accessing a PostgreSQL database from the asyncio
Stars: ✭ 1,097 (+195.69%)
Mutual labels:  asyncio, sqlalchemy
dvhb-hybrid
A package to mix django and asyncio in one application
Stars: ✭ 45 (-87.87%)
Mutual labels:  sqlalchemy, asyncio
nebulo
Instant GraphQL API for PostgreSQL and SQLAlchemy
Stars: ✭ 74 (-80.05%)
Mutual labels:  postgres, sqlalchemy
fastapi-boilerplate
FastAPI boilerplate for real world production
Stars: ✭ 145 (-60.92%)
Mutual labels:  sqlalchemy, asyncio
Backendschool2019
Приложение для практического руководства по разработке бекенд-сервисов на Python (на основе вступительного испытания в Школу бэкенд‑разработки Яндекса)
Stars: ✭ 129 (-65.23%)
Mutual labels:  asyncio, sqlalchemy
Tornado Sqlalchemy
SQLAlchemy support for Tornado
Stars: ✭ 112 (-69.81%)
Mutual labels:  asyncio, sqlalchemy
Aiomysql
aiomysql is a library for accessing a MySQL database from the asyncio
Stars: ✭ 1,252 (+237.47%)
Mutual labels:  asyncio, sqlalchemy
Sqlalchemy aio
Asyncio strategy for SQLAlchemy.
Stars: ✭ 299 (-19.41%)
Mutual labels:  asyncio, sqlalchemy
fast-api-sqlalchemy-template
Dockerized web application on FastAPI, sqlalchemy1.4, PostgreSQL
Stars: ✭ 25 (-93.26%)
Mutual labels:  sqlalchemy, asyncio
Flask Boilerplate
Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
Stars: ✭ 251 (-32.35%)
Mutual labels:  sqlalchemy, postgres
Web Applications With Fastapi Course
Demo code and other handouts for students of our FastAPI Web Apps course.
Stars: ✭ 56 (-84.91%)
Mutual labels:  asyncio, sqlalchemy
mathesar
Web application providing an intuitive user experience to databases.
Stars: ✭ 95 (-74.39%)
Mutual labels:  postgres, sqlalchemy
fastapi-sqlalchemy-1.4-async
https://rogulski.it/blog/sqlalchemy-14-async-orm-with-fastapi/
Stars: ✭ 17 (-95.42%)
Mutual labels:  sqlalchemy, asyncio

Documentation Status

asyncpgsa

A python library wrapper around asyncpg for use with sqlalchemy

Backwards incompatibility notice

Since this library is still in pre 1.0 world, the api might change. I will do my best to minimize changes, and any changes that get added, I will mention here. You should lock the version for production apps.

  1. 0.9.0 changed the dialect from psycopg2 to pypostgres. This should be mostly backwards compatible, but if you notice weird issues, this is why. You can now plug-in your own dialect using pg.init(..., dialect=my_dialect), or setting the dialect on the pool. See the top of the connection file for an example of creating a dialect. Please let me know if the change from psycopg2 to pypostgres broke you. If this happens enough, I might make psycopg2 the default.

  2. 0.18.0 Removes the Record Proxy objects that would wrap asyncpg's records. Now asyncpgsa just returns whatever asyncpg would return. This is a HUGE backwards incompatible change but most people just used record._data to get the object directly anyways. This means dot notation for columns is no longer possible and you need to access columns using exact names with dictionary notation.

  3. 0.18.0 Removed the insert method. We found this method was just confusing, and useless as SqlAlchemy can do it for you by defining your table with a primary key.

  4. 0.27.0 Now only compatible with version 0.22.0 and greater of asyncpg.

sqlalchemy ORM

Currently this repo does not support SA ORM, only SA Core.

As we at canopy do not use the ORM, if you would like to have ORM support feel free to PR it. You would need to create an "engine" interface, and that should be it. Then you can bind your sessions to the engine.

sqlalchemy Core

This repo supports sqlalchemy core. Go here for examples.

Docs

Go here for docs.

Examples

Go here for examples.

install

pip install asyncpgsa

Note: You should not have asyncpg in your requirements at all. This lib will pull down the correct version of asyncpg for you. If you have asyncpg in your requirements, you could get a version newer than this one supports.

Contributing

To contribute or build this locally see contributing.md

FAQ

Does SQLAlchemy integration defeat the point of using asyncpg as a backend (performance)?

I dont think so. asyncpgsa is written in a way where any query can be a string instead of an SA object, then you will get near asyncpg speeds, as no SA code is ran.

However, when running SA queries, comparing this to aiopg, it still seams to work faster. Here is a very basic timeit test comparing the two. https://gist.github.com/nhumrich/3470f075ae1d868f663b162d01a07838

aiopg.sa: 9.541276566000306
asyncpsa: 6.747777451004367

So, seems like its still faster using asyncpg, or in otherwords, this library doesnt add any overhead that is not in aiopg.sa.

Versioning

This software follows Semantic Versioning.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].