Convert SQL to SQLITE
Turn SQL files into SQLITE. The statements are replayed into a new SQLite database.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop SQL files on the dialor turn it to pick what to do
A SQLite database built from your SQL script or database dump.The statements run into a new database. A MySQL, MariaDB or PostgreSQL dump is rewritten into SQLite's dialect first.
What you get
One SQLite database file. Every table the script creates is there with its columns and all of its rows.
Primary keys, unique keys and foreign keys stay on the tables. Keys that a dump adds at the end, as pg_dump and phpMyAdmin do, are moved into the tables.
The database file can carry the extension sqlite, sqlite3 or db.
Dumps from MySQL and PostgreSQL
A dump written by mysqldump or phpMyAdmin is read as MySQL. A plain dump written by pg_dump is read as PostgreSQL, with its COPY rows and its INSERT rows alike.
Each column takes the nearest SQLite type. ENUM, SET, JSON, arrays and times with a time zone are kept as text. Binary values become blobs, and PostgreSQL true and false become 1 and 0. PostgreSQL's NaN becomes NULL, since SQLite cannot store it.
Dates that are not real dates become NULL. MySQL's 0000-00-00 is one of them.
The partitions of a PostgreSQL table are joined into that table. Tables of the same name in two databases or schemas keep apart, named after them.
What is left out
Views, functions, procedures, triggers, indexes, sequences and permissions are left out. A warning counts the views, routines and triggers that were left out.
A script in SQLite's own dialect runs as it is. A script in another dialect, such as SQL Server's, fails at its first foreign statement.
When it stops
A dump that was cut short stops the conversion with
input_corrupted. A statement SQLite cannot take stops it withunsupported_elements.To go the other way, SQLITE to SQL turns a database back into a script.
SQL and SQLITE.What each format is.
The formats
SQL Script
SQL statements as text. A database dump that any SQL tool can read or replay.
- Extensions
- .sql
- MIME type
- application
/sql - Kind
- Text and data
SQLite Database
A whole relational database in one file. Tables, indexes and views.
- Extensions
- .sqlite .sqlite3 .db
- MIME type
- application
/vnd .sqlite3 - Kind
- Text and data
In your code.The same SQL to SQLITE conversion through the API, for your app or your agent.
$ cv convert report.sql report.sqlite$ cv convert report.sql report.sqliteQuestions.What people ask about SQL to SQLITE.
Yes. A dump from mysqldump, phpMyAdmin or pg_dump is rewritten into SQLite's dialect, so its tables and rows come through.
They become NULL. A date such as 0000-00-00 is not a real date, so it is left empty.
No. They are written in the other database's own SQL, so they are left out, and a warning counts them.
It means the dump was cut short or could not be parsed. The conversion stops with that code.
No. This conversion has no options, and it gives one file.