Skip to content

A modern, cross-platform SQL Server schema comparison and deployment tool built with Tauri + React

License

Notifications You must be signed in to change notification settings

jmarbutt/schema-sync

Repository files navigation

SchemaSync

License: MIT Tauri React

A modern, cross-platform SQL Server schema comparison and deployment tool built with Tauri (Rust) + React. Think Redgate SQL Compare, but open-source and works on Mac/Linux/Windows.

Features

  • Schema Comparison: Compare two SQL Server databases and see all differences
  • Supported Objects: Tables, columns, indexes, primary keys, foreign keys, unique constraints, check constraints, default constraints, views, stored procedures, functions, and triggers
  • Side-by-Side Diff View: Monaco Editor-powered diff view for comparing object definitions
  • Script Generation: Generate deployment T-SQL scripts with proper dependency ordering
  • Safe Deployment: Transactions, error handling, and rollback support
  • Breaking Change Detection: Visual indicators for potentially breaking changes

Tech Stack

  • Framework: Tauri 2.x (Rust backend, ~10-15MB app)
  • Frontend: React 19 + TypeScript + Vite
  • Styling: TailwindCSS 4 + shadcn-inspired components
  • State: Zustand
  • Diff UI: Monaco Editor (side-by-side)
  • SQL Server: tiberius crate (Rust)
  • Dependency Graph: petgraph crate

Getting Started

Prerequisites

Development

# Install dependencies
pnpm install

# Run development server
pnpm tauri dev

Build

# Build for production
pnpm tauri build

The built application will be in src-tauri/target/release/bundle/.

Usage

  1. Connect to Databases: Enter connection details for your source (what you want) and target (what you have) databases
  2. Compare: Click "Compare Schemas" to analyze differences
  3. Review: Browse the diff tree, select/deselect changes to deploy
  4. Generate Script: Generate a T-SQL deployment script
  5. Deploy: Execute the script directly or download for manual execution

Project Structure

schema-sync/
├── src-tauri/                    # Rust backend
│   ├── src/
│   │   ├── commands/             # Tauri IPC handlers
│   │   ├── db/                   # Database connection layer
│   │   ├── schema/               # Schema extraction
│   │   ├── compare/              # Comparison engine
│   │   ├── script/               # Script generation
│   │   └── deploy/               # Deployment execution
├── src/                          # React frontend
│   ├── components/
│   │   ├── ui/                   # Base UI components
│   │   ├── connection/           # Connection forms
│   │   ├── comparison/           # Diff tree and editor
│   │   ├── script/               # Script preview
│   │   └── deployment/           # Progress UI
│   ├── stores/                   # Zustand stores
│   └── types/                    # TypeScript types

Authentication

Supports multiple authentication methods:

  • SQL Server Authentication (username/password)
  • Windows Authentication (Windows only)
  • Azure Active Directory (token-based)

Safe Deployment Order

The script generator ensures objects are modified in the correct order:

  1. Drop triggers
  2. Drop foreign keys
  3. Drop check/default constraints
  4. Drop indexes
  5. Drop primary keys
  6. Modify columns
  7. Create/drop tables
  8. Create primary keys
  9. Create indexes
  10. Create constraints
  11. Create foreign keys
  12. Create triggers

Installation

Pre-built Binaries

Download the latest release for your platform from the Releases page.

Build from Source

See Getting Started above.

Schema Exclusion

By default, the cdc (Change Data Capture) schema is excluded from comparison. You can configure additional schemas to exclude using the "Exclude Schemas" button in the UI.

Azure SQL Support

SchemaSync handles Azure SQL's auto-generated constraint names (like PK__TableName__ABC123) by comparing constraints structurally rather than by name. This means:

  • Primary keys are matched by columns and clustering
  • Foreign keys are matched by columns and referenced table/columns
  • Indexes are matched by columns, included columns, uniqueness, and clustering
  • Unique constraints are matched by columns and clustering

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Roadmap

  • Saved connections with encryption
  • Comparison history
  • Rollback script generation
  • Data comparison (not just schema)
  • PostgreSQL support
  • MySQL support
  • Column mapping for renames

Acknowledgments

License

MIT License - see LICENSE for details.

About

A modern, cross-platform SQL Server schema comparison and deployment tool built with Tauri + React

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •