Alembic runs migration scripts on SQLite and MariaDB in auto-commit mode, so inserting many rows with individual insert statements is extremely slow.