Data Sync is an automated tool for comparing database schemas and data. It can compare two databases, whether they are local or remote, and automatically produce a migration file of the differences.
If you find this extension useful for your projects, please consider supporting me by Patreon, KO-FI or Paypal. It's a great way to help me maintain and improve this tool in the future. Your support is truly appreciated!
Get it from Visual Studio Marketplace or Open VSX Registry.
- Connects to a source and target database to perform the comparison.
- Can compare changes to both the schema and data, and generate valid SQL to update the target database to match the source.
- Allows you to ignore certain tables or fields during the comparison.
- Currently only works with PostgreSQL, but we plan to expand to other databases based on user demand in the future.
Using the extension
Step 1: Configuration
On the first time, you need create the configuration.
You can quickly create your configuration from Data Sync Explorer or Command Palette.
// A Boolean variable indicating whether to include verbose log in migrate data.
// List of migrate pattern, multiple pattern can be defined.
// Your defined pattern
// Your source database connection section
// database connection string
// passed directly to node.TLSSocket, supports all tls.connect options
// custom type parsers
// number of milliseconds before a statement in query will time out, default is no timeout
// number of milliseconds before a query call will timeout, default is no timeout
// the name of the application that created this Client instance
// number of milliseconds to wait for connection, default is no timeout
// number of milliseconds a client must sit idle in the pool
// maximum number of clients the pool should contain by default this is set to 10.
// default behavior is the pool will keep clients open & connected
// Number of milliseconds before terminating any session with an open idle transaction, default is no timeout
// Your target database connection section
// And other property you can defined (same as source)
// You diff options
// Auto format diff data (UNDER DEVELOPMENT)
// The table you want to diff changes.
// The database table schema
// The database table name
// Exclude one or more columns
// Custom where query (.e.g customer_id = 'JHQMFFE8sJ')
// Custom order by column (.e.g iam_role_code, iam_policy_code)
// Define columns you want get to compare, default all column
// Define primary keys of table, to check table row is unique
// Your migrate options
// No generate the insert record.
// No generate the update record.
// No generate the delete record.
// Action on no row affected when migrate data
"noRowAffected": "ignore" | "log" | "warn" | "throw",
// Action on multiple row affected when migrate data
"multipleRowAffected": "ignore" | "log" | "warn" | "throw"
Step 2: Analyze different data
Step 3. Review changes
Step 4. Review migrate file
Step 5. Apply changes
Import migration data
View process info
Quick open configuration
Generate Configuration from Data Sync Explorer
Generate Configuration from Command Palette
If you discover a bug, or have a suggestion for a feature request, please
submit an issue.
This extension is licensed under the MIT License