Skip to main content

table manager for aiomysql.

Project description

MySQLer

Easily generate SQL.

Install

pip install MySQLer

Example

import asyncio

from mysqler import Table, ColumnType
from aiomysql import connect

class FavoritefoodTable(Table):
    user = ColumnType.BIGINT
    food = ColumnType.TEXT
    
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.4.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

MySQLer-0.0.4-py3-none-any.whl (4.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