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](https://github.com/encode/databases) dependency.
## Usage
```python
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
```
=======
History
=======
0.1.0 (2019-04-07)
------------------
* First release on PyPI.
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](https://github.com/encode/databases) dependency.
## Usage
```python
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
```
=======
History
=======
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.1.tar.gz
(9.0 kB
view details)
File details
Details for the file asyncom-0.1.1.tar.gz
.
File metadata
- Download URL: asyncom-0.1.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 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 | b3257d41c1224689e7e4b926ff88984e4316cb5fdbb7bc4d83ee49b69f8e2d3b |
|
MD5 | c00d519f3b8933e3ce6abedd5ab36096 |
|
BLAKE2b-256 | 792d389d1b6a25ad125df59e78e50b594b0423402abced95e12f2533e0b6a8b8 |