Skip to content

yateendra/Transform-SQL-to-TypeScript-entity-classes

Repository files navigation

SQL to TypeORM Converter

A modern web application that transforms MySQL table definitions into TypeORM entity classes. Built with React, TypeScript, and Tailwind CSS, this tool helps developers quickly migrate from raw SQL schemas to TypeScript-based ORM entities.

Features

  • SQL Parser: Converts MySQL CREATE TABLE statements into TypeORM entities
  • Smart Type Mapping: Automatically maps SQL data types to TypeScript types
  • Decorator Generation: Creates appropriate TypeORM decorators with column options
  • History Tracking: Saves recent conversions for quick access
  • Example Templates: Provides common SQL schema examples
  • Copy to Clipboard: One-click copying of generated TypeORM code
  • Mobile Responsive: Works seamlessly across all device sizes

Technical Details

  • Frontend: React 18 with TypeScript
  • Styling: Tailwind CSS for modern, responsive design
  • State Management: React Context API
  • Icons: Lucide React for consistent iconography
  • Storage: Local storage for conversion history
  • Build Tool: Vite for fast development and optimized production builds

Supported Features

  • Table name and column parsing
  • Primary key and auto-increment detection
  • Nullable fields
  • Default values
  • Column length specifications
  • Unique constraints
  • Custom column names
  • Comments parsing
  • SQL dump cleaning

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Project Structure

src/
  ├── components/      # React components
  ├── context/        # React context for state management
  ├── utils/          # Utility functions including SQL parser
  ├── types/          # TypeScript type definitions
  └── main.tsx        # Application entry point

License

MIT

About

Transform your MySQL table definitions into TypeScript entity classes for TypeORM.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published