Small and partial Obejct mapper on top of sqlalchemy for async
Project description
AsyncOM
Async OM it's a super basic Object mapper based almost all on sqlalchemy ORM layer.
We use the declarative extension for building the classes, and also, factor instances of them on querys.
There is still no support for relations. At the moment it's tied to the encode/databases dependency.
Usage
from sqlalchemy.ext.declarative import declarative_base import sqlalchemy as sa Base = declarative_base() class OrmTest(Base): __tablename__ = 'orm_test' id = sa.Column(sa.Integer, primary_key=True) name = sa.Column(sa.String(100), index=True) value = sa.Column(sa.Text) # Instead of usign Database from databases, you can use: db = OMDatabase() res = await db.query(OrmTest).filter( OrmTest.name.like('xx')).all() # Look at tests
Changelog
0.1.5
- Load inherited models.
0.1.4
- query(Object).get should return None if not found
0.1.3
- Fixes and improvements. Lay out basic API
0.1.0 (2019-04-07)
- First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size asyncom-0.1.5-py2.py3-none-any.whl (4.8 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size asyncom-0.1.5.tar.gz (9.5 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for asyncom-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc82467c043c976a9493098bcaae8c0dc668feac29f8193c5b4c08eede77e80 |
|
MD5 | 158da7671ff15bff4ba1f9927685f81e |
|
BLAKE2-256 | 06c529c694dbc1566bfd37206c5ea201d7e7dbd7557b1c5d5f28a283ec1a62ba |