Skip to content

vldzz/sql-data-insert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SQL Data Generator

A modern, feature-rich web application for generating realistic SQL test data with support for multiple database types.

๐ŸŒŸ Features

Core Functionality

  • Multi-Database Support: Generate SQL for MySQL, PostgreSQL, SQL Server, and SQLite
  • Realistic Data Generation: Create test data using Faker.js with 30+ data types
  • Table Templates: Pre-built templates for common use cases (Users, Products, Library, etc.)
  • Advanced Column Configuration: Support for constraints, custom ranges, and data patterns
  • SQL Export Options: Generate CREATE, INSERT, Stored Procedures, and Migration scripts

Modern UI/UX

  • Dark/Light Mode: Toggle between themes with persistent settings
  • Responsive Design: Works seamlessly on desktop, tablet, and mobile
  • Loading States: Visual feedback during data generation
  • Error Handling: Comprehensive error boundaries and validation
  • Toast Notifications: User-friendly feedback messages

Data Types & Patterns

  • Basic Types: Int, Bigint, Float, Decimal, Money, Date, Time, DateTime
  • Text Types: Nvarchar, Text, Email, Phone, SSN, Credit Card
  • Business Data: Company, Job Title, Department, Product Name/Description
  • Location Data: Address, City, State, Country, Coordinates
  • Technical Data: IP Address, URL, Username, Password, UUID, MAC Address
  • Custom Patterns: ISBN, Color, Domain, and more

Advanced Features

  • History Tracking: Keep track of generated SQL scripts
  • Copy to Clipboard: One-click SQL copying
  • File Download: Export SQL scripts as files
  • Syntax Highlighting: Beautiful SQL code display
  • Form Validation: Real-time validation and error messages
  • Admin/User Roles: Different limits and features based on role

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 16+
  • npm or yarn

Installation

  1. Clone the repository:
git clone <repository-url>
cd sql-data-generator
  1. Install dependencies:
npm install
  1. Start the development server:
npm start
  1. Open http://localhost:3000 in your browser

Build for Production

npm run build

๐Ÿ› ๏ธ Technology Stack

Frontend

  • React 18: Modern React with hooks and functional components
  • Bootstrap 5: Responsive UI framework
  • React Hook Form: Form handling and validation
  • React Query: Data fetching and caching
  • React Icons: Beautiful icon library
  • React Syntax Highlighter: Code syntax highlighting
  • React Hot Toast: Toast notifications
  • Faker.js: Realistic data generation

Development Tools

  • React Error Boundary: Error handling
  • React Router: Navigation (ready for future expansion)
  • Webpack Bundle Analyzer: Bundle optimization

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ ModernApp.js          # Main application component
โ”‚   โ”œโ”€โ”€ Navigation.js          # Modern navigation bar
โ”‚   โ”œโ”€โ”€ ColumnConfig.js        # Column configuration form
โ”‚   โ”œโ”€โ”€ SQLResult.js           # SQL output display
โ”‚   โ”œโ”€โ”€ TableTemplates.js      # Pre-built table templates
โ”‚   โ”œโ”€โ”€ LoadingSpinner.js      # Loading indicators
โ”‚   โ””โ”€โ”€ ErrorBoundary.js       # Error handling
โ”œโ”€โ”€ contexts/
โ”‚   โ””โ”€โ”€ ThemeContext.js        # Dark/light mode context
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ dataGenerators.js      # Enhanced data generation
โ”‚   โ””โ”€โ”€ sqlGenerators.js       # Multi-database SQL generation
โ””โ”€โ”€ index.css                  # Modern styling with dark mode

๐ŸŽจ UI Improvements

Modern Design

  • Clean, professional interface
  • Consistent spacing and typography
  • Smooth animations and transitions
  • Accessible color contrast
  • Mobile-first responsive design

Dark Mode

  • Automatic theme detection
  • Persistent theme preference
  • Consistent styling across all components
  • Reduced eye strain in low-light environments

User Experience

  • Intuitive navigation with icons
  • Clear visual hierarchy
  • Helpful tooltips and labels
  • Responsive feedback for all interactions
  • Progressive disclosure of advanced features

๐Ÿ”ง Configuration

Database Types

  • MySQL: Full support with InnoDB engine
  • PostgreSQL: Native PostgreSQL syntax
  • SQL Server: T-SQL specific features
  • SQLite: Lightweight database support

Data Generation

  • Realistic Patterns: Email, phone, SSN, credit card formats
  • Custom Ranges: Integer ranges with min/max values
  • Custom Lists: Space-separated custom data lists
  • Constraints: Primary key, unique, and foreign key support

Templates

  • Users Management: Authentication and user data
  • E-commerce Products: Product catalog with pricing
  • Library Management: Books and authors
  • Healthcare Records: Patient and medical data
  • Manufacturing: Inventory and production tracking
  • Education System: Students and courses

๐Ÿš€ Deployment

GitHub Pages

npm run deploy

Other Platforms

  1. Build the project: npm run build
  2. Deploy the build folder to your hosting platform

๐Ÿ”ฎ Future Enhancements

Planned Features

  • Collaboration: Share table configurations
  • Version Control: Track configuration changes
  • API Integration: REST API for programmatic access
  • Plugin System: Third-party data generators
  • Analytics Dashboard: Usage statistics
  • Bulk Operations: Generate data for multiple tables
  • Advanced Relationships: Foreign key relationships
  • Data Export: JSON, CSV, Excel formats

Technical Improvements

  • TypeScript: Full TypeScript migration
  • Testing: Comprehensive unit and integration tests
  • Performance: Code splitting and lazy loading
  • PWA: Progressive Web App capabilities
  • Offline Support: Service worker implementation

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Commit changes: git commit -am 'Add feature'
  4. Push to branch: git push origin feature-name
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License.

๐Ÿ™ Acknowledgments

  • Faker.js: For realistic data generation
  • Bootstrap: For responsive UI components
  • React Community: For excellent documentation and tools
  • Font Awesome: For beautiful icons

SQL Data Generator - Making database testing easier and more realistic since 2024.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors