PowerShell database synchronization tool for SQL Server with INSERT, UPDATE, DELETE support and flexible field matching
Expert guidance for working with SyncRay, a PowerShell-based SQL Server database synchronization tool that enables safe, flexible data migration with full INSERT, UPDATE, and DELETE support.
SyncRay is a transaction-safe database synchronization tool designed for SQL Server. It supports flexible record matching on any field combination, comprehensive validation, dry-run previews, and export filtering with WHERE clauses.
```powershell
try {
# Database operations
} catch {
Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
throw
} finally {
# Always close connections
if ($connection) { $connection.Close() }
}
```
Before any database operation:
**matchOn behavior:**
**Special column handling:**
```powershell
./src/sync-export.ps1 -From source -Tables TestTable
./src/sync-import.ps1 -To target -Tables TestTable
./src/sync-import.ps1 -To target -Tables TestTable -Execute
./src/sync-export.ps1 -From source -ConfigPath ./test-config.json
```
When adding features, follow this order:
1. Update `sync-validation.ps1` if validation logic changes
2. Implement feature in `sync-export.ps1` or `sync-import.ps1`
3. Update `sync-config.example.json` if config schema changes
4. **Document in all four README files:**
- `README.md` (English)
- `README.de.md` (German/Deutsch)
- `README.fr.md` (French/Français)
- `README.es.md` (Spanish/Español)
5. Test with PowerShell 5.0
**NEVER include:**
**DO include:**
**Example commit messages:**
```
Add WHERE clause filtering to export script
Allow selective data export by applying WHERE conditions
to source queries. Useful for partial migrations and testing.
```
```
Fix primary key detection for composite keys
Validation now correctly identifies multi-column primary keys
and displays them in error messages for better diagnostics.
```
```powershell
$VerbosePreference = "Continue"
Write-Verbose "Executing query: $query"
```
1. Add WHERE clause parameter to export script
2. Append WHERE condition to SELECT queries
3. Validate SQL syntax before execution
4. Update all four README files with examples
5. Test with complex WHERE clauses
1. Modify `sync-validation.ps1` function
2. Add primary key lookup query
3. Format error message with key information
4. Test with invalid configurations
5. Update documentation if error format changes
1. Update example config JSON
2. Add validation logic for new option
3. Implement feature behavior
4. Update all README files
5. Test with both presence and absence of option
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/syncray-sql-database-sync/raw