Registry / database / pysqlsync

pysqlsync

JSON →
library0.8.4pypypiunverified

A Python library for synchronizing database schema and large volumes of data between different database engines. Version 0.8.4 supports PostgreSQL, MySQL, SQLite, and MSSQL. Active development with monthly releases.

pip install pysqlsync
INSTALL
IMPORT
SIG · PYSQLSYNC
P
pysqlsync
databasepythonv0.8.4
Install
3.3s avg
Import
Disk
49MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 48.7MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.3s · import 0.000s · 51MB
49MB installed
● package 49MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SyncEngine
from pysqlsync import SyncEngine
from pysqlsync.sync import SyncEngine

Connect to PostgreSQL, define a table, and sync data with upsert mode.

import asyncio from pysqlsync.sync.postgresql import PostgreSQLSyncEngine from pysqlsync.model import TableDef async def main(): # Connect and sync engine = PostgreSQLSyncEngine( host='localhost', port=5432, user='user', password=os.environ.get('PGPASSWORD', ''), database='mydb' ) await engine.connect() # Define a table table = TableDef(name='users', columns=[ {'name': 'id', 'type': 'integer', 'primary_key': True}, {'name': 'name', 'type': 'text'} ]) # Create table and sync data await engine.create_table(table) await engine.sync_data(table, [{'id': 1, 'name': 'Alice'}], mode='upsert') await engine.close() asyncio.run(main())
Debug
Known issues
breakingVersion 0.8.0 renamed 'SQLSyncEngine' to 'SyncEngine' and moved engines to submodules like 'pysqlsync.sync.postgresql'. Old imports from 'pysqlsync.engine.*' will fail.
fix
Update imports to use 'from pysqlsync.sync.postgresql import PostgreSQLSyncEngine' instead of 'from pysqlsync.engine.postgresql import PostgreSQLSyncEngine'.
affects: >=0.8.0
deprecatedThe 'mode' parameter in sync_data() with value 'replace' is deprecated in favor of 'upsert' or 'overwrite' since 0.7.0.
fix
Use mode='upsert' (insert or update) or mode='overwrite' (delete and insert).
affects: >=0.7.0
gotchaAll operations require an active event loop; running without asyncio.get_event_loop() will fail. Engine.connect() is async and must be awaited.
fix
Always run sync code inside async functions and use asyncio.run().
affects: All
gotchaIf optional database driver is not installed, import raises ModuleNotFoundError. pysqlsync does not auto-install drivers.
fix
Install required extras: pip install pysqlsync[postgresql] for PostgreSQL, etc.
affects: All
Upgrade
Version history
0.8.4latest on PyPI · released Nov 5, 2025
Audit
Dependencies
asyncpgoptionalRequired for PostgreSQL sync engine
aiomysqloptionalRequired for MySQL sync engine
aiosqliteoptionalRequired for SQLite sync engine
pymssqloptionalRequired for MSSQL sync engine
Agent activity
16 hits · last 30 days
node
14
Resources
pysqlsync — pip install pysqlsync · libregistry