Metadata-Version: 2.1
Name: triopg
Version: 0.2.0
Summary: PostgreSQL client for Trio based on asyncpg
Home-page: https://github.com/python-trio/triopg
Author: Emmanuel Leblond
Author-email: emmanuel.leblond@gmail.com
License: MIT -or- Apache License 2.0
Keywords: async,trio,sql,postgresql,asyncpg
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Framework :: Trio
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: SQL
Requires-Python: >=3.6
Requires-Dist: trio
Requires-Dist: trio-asyncio
Requires-Dist: asyncpg

.. image:: https://travis-ci.org/python-trio/triopg.svg?branch=master
   :target: https://travis-ci.org/python-trio/triopg
   :alt: Automated test status (Linux and MacOS)

.. image:: https://ci.appveyor.com/api/projects/status/4t8ydnax9p6ehauj/branch/master?svg=true
   :target: https://ci.appveyor.com/project/touilleMan/triopg/history
   :alt: Automated test status (Windows)

.. image:: https://codecov.io/gh/python-trio/triopg/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/python-trio/triopg
   :alt: Test coverage

triopg
======

Welcome to `triopg <https://github.com/python-trio/triopg>`__!

PostgreSQL client for Trio based on asyncpg

License: Your choice of MIT or Apache License 2.0

Quick example:

.. code-block:: python

    import trio_asyncio
    import triopg


    async def main():
        conn = await triopg.connect()

        await conn.execute(
            """
            DROP TABLE IF EXISTS users;
            CREATE TABLE IF NOT EXISTS users (
                _id SERIAL PRIMARY KEY,
                user_id VARCHAR(32) UNIQUE
            )"""
        )

        async with conn.transaction():
            await conn.execute("INSERT INTO users (user_id) VALUES (1)")
            await conn.execute("INSERT INTO users (user_id) VALUES (2)")
            await conn.execute("INSERT INTO users (user_id) VALUES (3)")

        print(await conn.execute("SELECT * FROM users"))


    trio_asyncio.run(main)


