A desktop SQL utility for SQL Server built with WPF on .NET 8.
DatabaseManager combines query authoring, schema exploration, template management, result export, stored procedure execution, and transactional row editing in a single Windows app.
- SQL editor tab with multiline query authoring.
- Schema Assistant panel for tables, procedures, and query templates.
- Query generation helpers (SELECT, INSERT, UPDATE, DELETE, EXEC, and table schema script).
- Query template persistence in local app data.
- Result viewing and export to CSV and Excel.
- Stored procedure runner with parameter input.
- Edit Rows mode:
- Load
TOP (N)rows from a selected table. - Optional
WHEREpredicate andORDER BYexpression. - Two-way sync between filter inputs and generated editable SQL.
- PK-based update and delete operations in SQL transactions.
- Load
- Dark and light themes.
- Object Explorer toggle and keyboard shortcuts.
Save the screenshots under docs/images/ using the filenames below, then they will render here automatically.
- UI: WPF (
net8.0-windows) - Core logic/services: .NET (
net8.0) - SQL provider:
Microsoft.Data.SqlClient - Exports:
- CSV:
CsvHelper - Excel:
ClosedXML
- CSV:
- Tests: xUnit
DatabaseManager.slnx
src/
DatabaseManager.Core/
DatabaseManager.Wpf/
tests/
DatabaseManager.Tests/
See detailed architecture in docs/ARCHITECTURE.md.
- Windows 10/11
- .NET 8 SDK
- Access to a SQL Server instance
Optional:
- GNU Make, if you want to use the provided
Makefileshortcuts
dotnet restore DatabaseManager.slnx
dotnet build DatabaseManager.slnx -c Debug
dotnet run --project src/DatabaseManager.Wpf/DatabaseManager.Wpf.csproj -c Debugdotnet test DatabaseManager.slnx -c Debugmake build CONFIG=Debug
make run CONFIG=Debug
make test CONFIG=Debug- Enter a SQL Server connection string in the bottom connection panel.
- Set timeout in seconds.
- Click Test to validate and load schema metadata.
Use the left Schema Assistant tabs:
- Tables: search and inspect table columns/definition.
- Stored Procedures: search and inspect parameters/definition.
- Query Templates: save, load, refresh, and delete templates.
- Open the SQL Editor tab.
- Enter SQL or use generation actions from object context menus.
- Click Run.
- Review output in Results.
- Select a table from Schema Assistant.
- Open Edit Rows tab.
- Configure:
TopFilter(optional SQL predicate body)Order By(optional SQL order expression)
- Click Load.
- Modify rows directly in grid.
- Click Save Changes to commit updates.
- Right-click row and choose Delete Row... to remove a row.
Notes:
- Save and delete require a primary key.
- Save and delete actions are transactional.
- Select procedure in Schema Assistant.
- Open Procedure Runner.
- Provide parameter values.
- Click Execute Procedure.
In Results tab:
- Export CSV
- Export Excel
Ctrl+E: Run queryCtrl+Q: Cancel running query
- Query templates are stored in:
%LocalAppData%/DatabaseManager/query-templates.json
- Protect credentials in connection strings.
FilterandOrder Byin Edit Rows are interpreted as SQL fragments for row loading; use trusted input.- Row value writes are parameterized.
- SQL object names are escaped in row-edit operations.
- Focused on SQL Server (
Microsoft.Data.SqlClient). - Edit Rows update/delete requires table primary key metadata.
- Query execution is single batch per run button action.
- Documentation Index: docs/README.md
- Architecture: docs/ARCHITECTURE.md
- User Guide: docs/USER_GUIDE.md
- Troubleshooting: docs/TROUBLESHOOTING.md
Current tests include:
- Export service behavior
- Query assistant SQL generation
- Template storage CRUD behavior
See: tests/DatabaseManager.Tests
- Create a branch.
- Build and run tests.
- Keep UI and service behavior aligned with existing architecture.
- Submit a PR with clear change notes and validation steps.

