Convert Arrow to SQL Online
Convert Arrow files to SQL INSERT statements directly in your browser. Copy or download the generated SQL — no upload required.
About converting Arrow to SQL
Arrow to SQL is a way to move a data frame into a relational database without SQLAlchemy, a driver or a DataFrame.to_sql call. Save the frame as Arrow, convert it here, and paste the CREATE TABLE and INSERT statements into psql, the SQLite shell, DBeaver or a migration file. It suits seeding a test database, sharing a reproducible example, or loading a small lookup table. Because the column types come from the Arrow schema, nothing is guessed from the values, as it would be when starting from CSV.
Arrow has more integer types than most databases. Signed widths keep their size, although PostgreSQL has no TINYINT. Unsigned types are declared as the next wider signed type, so every value still fits. float64 is declared as DOUBLE PRECISION and float32 as REAL. Check the CREATE TABLE statement against your database before running it.
The script contains at most the first 1,000 rows. NaN and infinite values in a float column are written as the quoted strings 'NaN', 'Infinity' and '-Infinity'. PostgreSQL and DuckDB read those into float columns. MySQL and SQLite have no NaN, so replace it with null first if you target them.
Worked example
A small sample file, converted with the default settings.
Input (Arrow)
Arrow IPC file (binary, columnar) — shown as a table with its schema
| sensor_id | site | read_at | temp_c | ok |
|---|---|---|---|---|
| 101 | Dock A | 2026-03-02 09:15:00.123 | 4.25 | true |
| 102 | Dock A | 2026-03-02 09:15:00.125 | 4.5 | true |
| 205 | Cold Room 2 | 2026-03-02 09:15:01 | -18.75 | true |
| 311 | Loading Bay | 2026-03-02 09:15:01.004 | NULL | false |
Schema: sensor_id INTEGER, site VARCHAR, read_at TIMESTAMP_NS, temp_c DOUBLE, ok BOOLEAN
Output (SQL)
CREATE TABLE IF NOT EXISTS "data" (
"sensor_id" INTEGER,
"site" TEXT,
"read_at" TIMESTAMP,
"temp_c" DOUBLE PRECISION,
"ok" BOOLEAN
);
INSERT INTO "data" VALUES (101, 'Dock A', '2026-03-02 09:15:00.123', 4.25, true);
INSERT INTO "data" VALUES (102, 'Dock A', '2026-03-02 09:15:00.125', 4.5, true);
INSERT INTO "data" VALUES (205, 'Cold Room 2', '2026-03-02 09:15:01', -18.75, true);
INSERT INTO "data" VALUES (311, 'Loading Bay', '2026-03-02 09:15:01.004', NULL, false);What changes when you convert Arrow to SQL
- The table name comes from the Arrow file name, with unsafe characters replaced by underscores, and identifiers are double-quoted.
- int8, int16, int32 and int64 become TINYINT, SMALLINT, INTEGER and BIGINT. Unsigned types move up one size: uint8 becomes SMALLINT, uint16 INTEGER, uint32 BIGINT and uint64 NUMERIC(20,0).
- float64 becomes DOUBLE PRECISION and float32 becomes REAL. decimal128(p,s) keeps its DECIMAL(p,s) declaration.
- Timestamps, including nanosecond and timezone-aware ones, are declared as TIMESTAMP and written in UTC with millisecond precision. utf8 and dictionary columns become TEXT.
- Nulls are written as NULL, like temp_c for sensor 311. NaN is written as the quoted string 'NaN'.
Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.
Frequently Asked Questions
Will PostgreSQL accept the unsigned integer columns?
Yes. Unsigned columns are declared as standard signed types one size up, with NUMERIC(20,0) for uint64. The one type PostgreSQL still lacks is TINYINT, used for int8 columns, so change it to SMALLINT.
Will NaN values break the INSERT statements?
Not in PostgreSQL or DuckDB. NaN is written as the quoted string 'NaN', which both cast into a float column. MySQL and SQLite have no NaN, so replace it with NULL in the script, or clean the column before converting.
Is this faster than DataFrame.to_sql?
For a few hundred rows it is simpler, not faster. For larger tables, write CSV and use COPY or LOAD DATA, or have the database read Parquet directly.
What is SQL format?
SQL (Structured Query Language) is the standard language for querying and manipulating relational databases. The output contains CREATE TABLE and INSERT INTO statements ready to run against any SQL-compatible database.
Related Tools
Arrow Viewer Online
View and inspect Arrow files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Convert Arrow to CSV Online
Convert Arrow files to CSV format directly in your browser. No upload required — your data never leaves your device.
Convert Arrow to Parquet Online
Convert Arrow files to Parquet format directly in your browser. No upload required — your data never leaves your device.
Convert Arrow to Excel Online
Convert Arrow files to Excel format directly in your browser. No upload required — your data never leaves your device.
Convert Arrow to JSON Online
Convert Arrow files to JSON format directly in your browser. No upload required — your data never leaves your device.