Skip to content

Repository files navigation

RepoSQL - Professional SQL Script Generator

image

A powerful, modern desktop application for generating SQL scripts and creating database backups with a professional UI/UX experience.

πŸš€ Features

πŸ“‹ Script Generation

  • Table Creation Scripts - Generate complete CREATE TABLE statements with proper data types, constraints, and identity columns
  • Data Export - Export table data as INSERT statements (configurable row limits)
  • Views & Procedures - Export views, stored procedures, and user-defined functions
  • Indexes & Triggers - Generate index creation and trigger scripts
  • Permissions - Export security and permission scripts

πŸ’Ύ Database Backup

  • Enhanced Backup Manager - Intelligent backup with automatic directory detection
  • Multiple Backup Methods - Standard method and SQLCMD fallback for permission issues
  • Compression Support - Automatic ZIP compression with progress tracking
  • SQL Server Version Detection - Adapts features based on SQL Server version and edition

βš™οΈ Advanced Configuration

  • INI-based Settings - Persistent configuration with auto-save functionality
  • DROP Statement Generation - Optional IF EXISTS DROP statements before CREATE
  • File Overwrite Control - Configurable file overwrite behavior
  • Connection Profiles - Save and load database connection profiles

🎨 Modern UI/UX

  • Professional Interface - Clean, modern design with intuitive navigation
  • Real-time Progress - Visual progress indicators for all operations
  • Smart Status Updates - Color-coded button states and detailed status messages
  • Table Search & Filter - Quick table search with pattern matching
  • Bulk Selection Tools - Select all, select none, and invert selection

πŸ› οΈ Technical Specifications

.NET VB.NET SQL Server Windows

  • Framework: .NET 8.0 Windows Forms
  • Language: Visual Basic .NET
  • Database: SQL Server 2012 and later
  • Authentication: Windows Authentication & SQL Server Authentication
  • IDE: Visual Studio 2022

πŸ“¦ Dependencies

<PackageReference Include="Microsoft.Data.SqlClient" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.5" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.5" />

πŸš€ Getting Started

Prerequisites

  • Windows 10/11
  • .NET 8.0 Runtime
  • SQL Server 2012 or later
  • Visual Studio 2022 (for development)

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/RepoSQL.git
  2. Open RepoSQL.sln in Visual Studio 2022
  3. Build the solution (F6)
  4. Run the application (F5)

Quick Start

  1. Connect to Database

    • Enter server name and database name
    • Choose authentication method (Windows or SQL Server)
    • Click "πŸ”Œ Connect" to test connection
  2. Load Tables

    • Click "πŸ“‹ Load Tables" to retrieve database objects
    • Use search box to filter tables
    • Select tables using checkboxes or bulk selection tools
  3. Configure Options

    • Choose script types (Tables, Views, Procedures, etc.)
    • Enable "Include Table Data" for INSERT statements
    • Access advanced settings via Tools β†’ Settings
  4. Generate Scripts

    • Click "πŸ“ Select Output" to choose destination folder
    • Click "πŸš€ Generate SQL" to create script files
    • Use "πŸ’Ύ Backup DB" for database backup with compression

πŸ“ Generated Files

The application creates organized SQL files with standardized naming:

Output_Directory/
β”œβ”€β”€ 01_TableCreate.sql      # Table creation scripts
β”œβ”€β”€ 02_TableInsert.sql      # Table data (if enabled)
β”œβ”€β”€ 03_Views.sql            # View definitions
β”œβ”€β”€ 04_StoredProcedures.sql # Stored procedure scripts
β”œβ”€β”€ 05_Functions.sql        # User-defined functions
β”œβ”€β”€ 06_Indexes.sql          # Index creation scripts
β”œβ”€β”€ 07_Triggers.sql         # Trigger scripts
└── 08_Permissions.sql      # Permission and security scripts

βš™οΈ Configuration

Settings (Tools β†’ Settings)

  • Generate DROP Statements: Add IF EXISTS DROP statements before CREATE
  • Overwrite Existing Files: Control file overwrite behavior without prompts

INI Configuration (sconfig.ini)

Settings are automatically saved to sconfig.ini in the application directory:

[ServerConfig]
Server=YourServer
Database=YourDatabase
IntegratedSecurity=True

[ScriptOptions]
Tables=True
Views=False
StoredProcedures=False
IncludeData=False

[GenerationSettings]
GenerateDropStatements=False
OverwriteExistingFiles=True

πŸ”§ Advanced Features

Database Backup Manager

  • Smart Directory Detection: Automatically finds SQL Server accessible directories
  • Permission Handling: Handles SQL Server permission issues gracefully
  • Progress Tracking: Real-time backup progress with percentage completion
  • Compression: Automatic ZIP compression with size optimization
  • Fallback Methods: SQLCMD alternative for problematic environments

Enhanced Error Handling

  • SQL Error Translation: User-friendly error messages with solutions
  • Connection Validation: Comprehensive connection testing
  • File System Checks: Automatic directory creation and permission validation

🎯 Use Cases

  • Database Migration: Export complete database structure and data
  • Version Control: Generate scripts for source control integration
  • Database Documentation: Create comprehensive database documentation
  • Backup & Recovery: Regular database backups with compression
  • Development: Quick script generation for development environments
  • Schema Comparison: Export schemas for comparison tools

πŸ“Š Performance

  • Async Operations: Non-blocking UI during database operations
  • Memory Efficient: Streaming data processing for large tables
  • Timeout Management: Configurable timeouts for large operations
  • Progress Feedback: Real-time progress updates for all operations

🀝 Contributing

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

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

  • Issues: GitHub Issues
  • Documentation: Check the wiki for detailed documentation
  • Feature Requests: Use GitHub Issues with enhancement label

πŸŽ‰ Acknowledgments

  • Built with love using Visual Basic .NET and Windows Forms
  • Inspired by the need for a modern, user-friendly SQL script generator
  • Thanks to the SQL Server development community for best practices

Made with VB.NET Platform License

RepoSQL v2.0 - Professional SQL Script Generator for Modern Databases

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages