Documentation

Complete technical reference for CSV to SQL Converter. Learn about features, configuration options, and best practices.

Overview

CSV to SQL Converter is a powerful web-based tool that transforms CSV (Comma-Separated Values) files into SQL INSERT statements for various database systems. It supports multiple databases including MySQL, PostgreSQL, SQLite, SQL Server, Oracle, and MongoDB.

Key Benefits

  • • No installation required - works directly in your browser
  • • Privacy-focused - all processing happens locally
  • • Supports multiple database formats
  • • Automatic data type detection
  • • Real-time preview and validation

Features

📊 Real-time Statistics

View row count, column count, total cells, and file size as you upload.

🔍 Column Type Detection

Automatically detects INTEGER, VARCHAR, DATE, BOOLEAN, and more.

⚙️ Custom Delimiters

Support for comma, semicolon, tab, pipe, and custom delimiters.

🎨 Syntax Highlighting

Color-coded SQL output for better readability.

📋 Copy Feedback

Toast notifications with character count when copying SQL.

⌨️ Keyboard Shortcuts

Ctrl+V paste, Ctrl+C copy, Ctrl+Enter generate, and more.

📈 Column Statistics

Min/max/avg for numeric columns, unique counts, fill rates.

🎯 Index Suggestions

Auto-suggests indexes for likely search columns with priority levels.

Data Type Detection

The converter automatically analyzes your CSV data and assigns appropriate SQL data types:

Detected TypeDescriptionExample
INTEGERWhole numbers without decimals42, -10, 0
DECIMALNumbers with decimal points3.14, -0.5, 99.99
BOOLEANTrue/false valuestrue, false, 1, 0
DATEISO date format2024-01-15
DATETIMEDate with time2024-01-15 10:30:00
VARCHARText strings (default)Hello, World!

Custom Delimiters

The converter supports various delimiter types for parsing your data files:

Comma (,)

Standard CSV format, most common delimiter

name,age,city

Semicolon (;)

Common in European locales

name;age;city

Tab (\t)

Tab-separated values (TSV)

name   age   city

Pipe (|)

Used in database exports

name|age|city

Output Formats

Generate SQL statements compatible with your target database:

MySQL

INSERT INTO users (name, age) VALUES ('John', 30);

PostgreSQL

INSERT INTO users (name, age) VALUES ('John', 30);

MongoDB

db.users.insertOne({name: "John", age: 30});

Advanced Options

NULL Handling

Control how empty cells are processed:

  • Empty String: Empty cells become ''
  • NULL: Empty cells become SQL NULL
  • Default Value: Empty cells use 'N/A'

Case Transformation

Transform column names to match your naming convention:

  • snake_case: first_name, last_name
  • camelCase: firstName, lastName
  • PascalCase: FirstName, LastName
  • UPPER_CASE: FIRST_NAME, LAST_NAME

Best Practices

✓ Clean Your Data First

Remove unnecessary columns, fix encoding issues, and validate data before conversion.

✓ Use Appropriate Data Types

Review auto-detected types and adjust if needed for optimal database performance.

✓ Test with Sample Data

Test the generated SQL with a small sample before running on production databases.

✓ Consider Index Suggestions

Review and implement suggested indexes for better query performance.