Skip to main content

table manager for aiomysql.

Project description

MySQLer

Install

pip install MySQLer

Example

from mysqler import Table, StrColumn, IntColumn
from aiomysql import connect
import asyncio

class FavoritefoodTable(Table):
    user = IntColumn()
    food = StrColumn()
    
async def main():
    conn = await connect(host="127.0.0.1", password="", user="")
    async with conn.cursor() as cur:
        table = FavoritefoodTable()
        await cur.execute(table.create)
        await cur.execute(table.insert(user=938194919392, food="steak"))
        await conn.commit()
        await cur.execute(table.select(user=938194919392))
        print(await cur.fetchall())
        
    await conn.close()
    
asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MySQLer-0.0.3.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

MySQLer-0.0.3-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page