Skip to content

MySQL support#1312

Open
sinisaos wants to merge 72 commits intopiccolo-orm:masterfrom
sinisaos:mysql_engine
Open

MySQL support#1312
sinisaos wants to merge 72 commits intopiccolo-orm:masterfrom
sinisaos:mysql_engine

Conversation

@sinisaos
Copy link
Member

@sinisaos sinisaos commented Dec 3, 2025

Related to this discussion. Any help and feedback is welcome.

@dantownsend
Copy link
Member

I've got the tests running locally now. It's impressive that they're running.

I've tried the playground too, and it seems to work well. I do get things like this printed out in the console:

aiomysql/cursors.py:239: Warning: Unknown table 'piccolo_playground.band'

Do you see them too?

@sinisaos
Copy link
Member Author

I've got the tests running locally now. It's impressive that they're running.

I've tried the playground too, and it seems to work well. I do get things like this printed out in the console:

aiomysql/cursors.py:239: Warning: Unknown table 'piccolo_playground.band'

Do you see them too?

Yes. This is just a warning and is harmless because I am using cursor.description to get the column name. I use something like this

async with self.pool.acquire() as connection:
    async with connection.cursor() as cursor:
        await cursor.execute(query, args)
        rows = await cursor.fetchall()
        columns = (
            [desc[0] for desc in cursor.description] # use only ticket from ticket$concert$concert$band_1 and it works
            if cursor.description
            else []
        )
        await connection.autocommit(True)
        return [dict(zip(columns, row)) for row in rows]

and it works for related columns like this ticket$concert$concert$band_1

Another option would be to use aiomysql.DictCursor like this

async with self.pool.acquire() as connection:
    async with connection.cursor(aiomysql.DictCursor) as cursor:
        await cursor.execute(query, args)
        rows = await cursor.fetchall()
        await connection.autocommit(True)
        return rows

but it doesn't work for related columns like this ticket$concert$concert$band 1. ValueError like this ValueError: No matching column found with name == ticket$concert$concert$band_1 is raised. I think we should leave this as is, maybe we can come up with something better later.

@sinisaos sinisaos added the enhancement New feature or request label Dec 28, 2025
@sinisaos
Copy link
Member Author

sinisaos commented Feb 7, 2026

@dantownsend Have you perhaps considered merging this? If MySQL is in the master branch (officially supported) maybe someone will use it and that way we will get some feedback and be able to improve things or solve some potential bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants