Skip to content

usamam46-git/Excel_To_SQL

Repository files navigation

Excel to SQL Generator

Production-grade MVP for converting .xlsx workbooks into SQL schema and insert statements.

Stack

  • Next.js App Router
  • TypeScript
  • Tailwind CSS
  • shadcn/ui-style components
  • xlsx for workbook parsing
  • zod for upload validation

Install

npm install

Development

npm run dev

Open http://localhost:3000.

Build

npm run build

Features

  • Drag and drop .xlsx upload at /upload
  • In-memory parsing through POST /api/parse-excel
  • Multi-sheet support
  • Header detection
  • SQL type inference for INT, FLOAT, BOOLEAN, DATETIME, TEXT, and VARCHAR(255)
  • Sanitized snake_case table and column identifiers
  • Escaped SQL string literals
  • CREATE TABLE and INSERT INTO previews
  • Copy SQL to clipboard

Example Workbook

Use examples/sample-import.xlsx locally, or download it from the app home page.

Project Structure

app/
  page.tsx
  upload/page.tsx
  api/parse-excel/route.ts
components/
  excel/
    UploadCard.tsx
    SheetSelector.tsx
    SqlPreview.tsx
    UploadWorkspace.tsx
  ui/
lib/
  excel/
    parser.ts
    sqlGenerator.ts
    typeInference.ts
examples/
  sample-import.xlsx

About

A nice little tool to make imports from excel to sql easy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors