--- id: pysqlsync version: "1.0.0" license: MIT license_treatment: permissive maintenance: active --- # pysqlsync — Synchronize schema and large volumes of data License: permissive · Maintenance: active · Downloads: 107.5K/mo ## What it is and what it does pysqlsync is an async-first Python library for synchronizing database schemas and efficiently loading large volumes of data. It uses Python dataclasses to define table structures and generates CREATE, DROP, INSERT, MERGE, and DELETE SQL statements, then executes them asynchronously against database drivers like asyncpg or aiomysql. The library supports two main workflows: schema synchronization (comparing a source database state to a target Python dataclass definition and emitting transformation SQL) and data synchronization (inserting, upserting, or deleting rows from lists of tuples or dataclass instances). The package is built around async/await patterns to maximize throughput when working with large datasets. It handles type mapping across SQL dialects, supports enumerations and composite types, and can generate SQL from dataclass definitions or discover existing database schemas via information_schema or pg_catalog. Runtime dependencies are minimal (json_strong_typing, truststore, typing_extensions), and the library targets modern Python versions (3.10+). Use it for: - Generate CREATE TABLE scripts from Python dataclass definitions for schema initialization across multiple SQL dialects. - Discover and reflect existing database schemas into Python object hierarchies for programmatic inspection and comparison. - Synchronize a target database schema to match a desired state defined in Python dataclasses, emitting and executing ALTER/CREATE/DROP statements. - Bulk-insert or upsert millions of rows from in-memory lists or tuples with minimal CPU overhead using async operations. - Keep a local database replica in sync with remote data sources by efficiently merging incoming records into existing tables. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Synchronize database schemas and bulk-load data using Python dataclasses and async SQL generation, supporting PostgreSQL, MySQL, and other dialects. Yes, if you need async bulk data loading or schema synchronization in Python. The library is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers genuine performance advantages over traditional ORMs for insert/upsert workflows. Install friction is low. Not suitable if you require Python versions below 3.10 or prefer synchronous APIs. ## Install pip install pysqlsync uv add pysqlsync poetry add pysqlsync ## Installing pysqlsync Before you install: Low install friction with only three runtime dependencies. Active maintenance with recent releases; last commit 2026-07-24 and latest release 2026-07-06 indicate ongoing development. License in practice: MIT license permits commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install pysqlsync import dataclasses from pysqlsync import get_dialect, ConnectionParameters @dataclasses.dataclass class UserTable: id: int name: str engine = get_dialect("postgresql") params = ConnectionParameters(host="localhost", database="mydb") async with engine.create_connection(params) as conn: await conn.create_objects([UserTable]) await conn.insert_data(UserTable, [UserTable(id=1, name="Alice")]) Requires Python 3.10 or later; async/await usage requires an event loop (e.g., asyncio). Verify before relying: - Supported database dialects beyond PostgreSQL, MySQL, and Oracle mentioned in formation section. - Performance comparison baseline against SQLAlchemy or other ORMs in real-world scenarios. - Handling of complex nested composite types and collection types in practice. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 107.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags async database schema synchronization, bulk insert upsert merge sql, dataclass to sql table mapping, database schema discovery reflection, efficient data loading postgresql mysql, async-sql, schema-migration, bulk-operations [View on SkillFed](https://skillfed.io/packages/pysqlsync) · [View on PyPI](https://pypi.org/project/pysqlsync/)