diff --git a/README.md b/README.md index 275f76d..d8e28f9 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,29 @@ database migrations. **ORM is still under development: We recommend pinning any dependencies with `orm~=0.1`** +--- + +## Installation + +```shell +$ pip install orm +``` + +You can install the required database drivers with: + +```shell +$ pip install orm[postgresql] +$ pip install orm[mysql] +$ pip install orm[sqlite] +``` + +Driver support is provided using one of [asyncpg][asyncpg], [aiomysql][aiomysql], or [aiosqlite][aiosqlite]. +Note that if you are using any synchronous SQLAlchemy functions such as `engine.create_all()` or [alembic][alembic] migrations then you still have to install a synchronous DB driver: [psycopg2][psycopg2] for PostgreSQL and [pymysql][pymysql] for MySQL. + +--- + +## Quickstart + **Note**: Use `ipython` to try this from the console, since it supports `await`. ```python @@ -179,6 +202,13 @@ See TypeSystem for [type-specific validation keyword arguments][typesystem-field * `orm.JSON()` [sqlalchemy-core]: https://docs.sqlalchemy.org/en/latest/core/ +[alembic]: https://alembic.sqlalchemy.org/en/latest/ +[psycopg2]: https://www.psycopg.org/ +[pymysql]: https://github.com/PyMySQL/PyMySQL +[asyncpg]: https://github.com/MagicStack/asyncpg +[aiomysql]: https://github.com/aio-libs/aiomysql +[aiosqlite]: https://github.com/jreese/aiosqlite + [databases]: https://github.com/encode/databases [typesystem]: https://github.com/encode/typesystem [typesystem-fields]: https://www.encode.io/typesystem/fields/ diff --git a/setup.py b/setup.py index ddf5207..5e55658 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,12 @@ def get_packages(package): package_data={PACKAGE: ["py.typed"]}, data_files=[("", ["LICENSE.md"])], install_requires=["databases>=0.2.1", "typesystem"], + extras_require={ + "postgresql": ["asyncpg"], + "mysql": ["aiomysql"], + "sqlite": ["aiosqlite"], + "postgresql+aiopg": ["aiopg"] + }, classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Web Environment",