{"library":"pysqlsync","title":"pysqlsync","description":"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.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pysqlsync","pip install pysqlsync[postgresql,mysql]"],"cli":null},"imports":["from pysqlsync.sync import SyncEngine","from pysqlsync.sync.postgresql import PostgreSQLSyncEngine","from pysqlsync.sync.mysql import MySQLSyncEngine","from pysqlsync.sync.sqlite import SQLiteSyncEngine"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import asyncio\nfrom pysqlsync.sync.postgresql import PostgreSQLSyncEngine\nfrom pysqlsync.model import TableDef\n\nasync def main():\n    # Connect and sync\n    engine = PostgreSQLSyncEngine(\n        host='localhost',\n        port=5432,\n        user='user',\n        password=os.environ.get('PGPASSWORD', ''),\n        database='mydb'\n    )\n    await engine.connect()\n    \n    # Define a table\n    table = TableDef(name='users', columns=[\n        {'name': 'id', 'type': 'integer', 'primary_key': True},\n        {'name': 'name', 'type': 'text'}\n    ])\n    \n    # Create table and sync data\n    await engine.create_table(table)\n    await engine.sync_data(table, [{'id': 1, 'name': 'Alice'}], mode='upsert')\n    \n    await engine.close()\n\nasyncio.run(main())","lang":"python","description":"Connect to PostgreSQL, define a table, and sync data with upsert mode.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}