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.
Source Distribution
asyncom-0.1.5.tar.gz
(9.5 kB
view details)
Built Distribution
File details
Details for the file asyncom-0.1.5.tar.gz
.
File metadata
- Download URL: asyncom-0.1.5.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a152eb2ba3612f04b46e9e3acfbd05ae540965be64156b6e9fd6dc6019f68415 |
|
MD5 | e0b2362f2bf30aa4585a57b44430da41 |
|
BLAKE2b-256 | f5d515d8f6eaa62413911b3db1bc5642877e9170675089aa1ed36f51a2ad133b |
File details
Details for the file asyncom-0.1.5-py2.py3-none-any.whl
.
File metadata
- Download URL: asyncom-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dc82467c043c976a9493098bcaae8c0dc668feac29f8193c5b4c08eede77e80 |
|
MD5 | 158da7671ff15bff4ba1f9927685f81e |
|
BLAKE2b-256 | 06c529c694dbc1566bfd37206c5ea201d7e7dbd7557b1c5d5f28a283ec1a62ba |