SqlJam

Move tables across databases. Schema, data and all.

A desktop import/export tool that copies tables, indexes, constraints, sequences, partitions and rows between relational and OLAP databases, directly, as copies in the same schema, or through a self-describing SQL, Parquet, CSV or Excel export package you can import later. Imports into a database run in one transaction which an error rolls back, and rows are inserted, updated or skipped by key.

MySQLMariaDBPostgreSQLOracle SQL ServerDb2H2SQLite AccessDuckDBClickHouse
SqlJam main window with the table structure of an employee table
Why SqlJam

Migrations fail on the details

INSERT statements are easy. Everything around them is not.

Dialects disagree

Types, identity columns, default values and literals differ in every database.

→ The target dialect translates them.

Old servers refuse new SQL

Oracle 11g has no identity, SQL Server 2008 no OFFSET, PostgreSQL 9 no partitions.

→ Version subclasses generate compatible SQL.

Keys and indexes go missing

Data arrives, but primary keys, foreign keys, sequences and comments do not.

→ Table-level objects move together.

Scripts become monsters

Gigabyte data.sql files and BLOB literals that break 4000-byte limits.

→ 10 MB parts and LOB files.

Values get corrupted

Shifted timestamps, overflowing unsigned numbers, garbled bits and money.

→ A portable value pipeline.

Embeddings are locked in a vector database

Collections of Milvus, Qdrant, Weaviate, Pinecone, Elasticsearch, OpenSearch or Chroma never meet the SQL of the business data.

→ Collections go straight into a database with vectors.

The database hides behind a bastion

Production servers answer only through an SSH jump host.

→ An SSH tunnel per data source.

Features

Everything a table needs on the other side

Any-to-any

Every source/target combination, verified by tests.

Version-aware

Dialects picked by detected or selected server version, vector types and indexes by the features detected on the target.

Keys & constraints

Primary keys, indexes, foreign keys, comments and sequences.

Partitions

Range, list, hash, interval, composite, reference and nested partitions kept for the same database type, partitioned tables marked in the tree.

Export packages

SQL, Parquet, CSV or Excel files, LOB files and manifest.json, split by size and imported in order.

One transaction

Checked by status, type and SHA-256, all or nothing or bad rows skipped and logged, confirmed before the commit if you want.

Progress you can see

Overall percentage, per-table progress, error log and cancel.

Migration reports

Every import and export leaves a report, also when it fails or is cancelled: rows per table checked against the target, skipped rows, objects and where it stopped, kept in the import history.

Scheduled sync

Changed rows by an update time or an increasing key, every N minutes or every day, run by SqlJam or by your own scheduler through its command line, vector collections too, a report for every run.

Dark by default

A modern JavaFX UI with 7 switchable themes.

Parquet, CSV & Excel

Columnar, text or spreadsheet packages and files of other tools, exact types, through an embedded DuckDB.

OLAP sources

DuckDB and ClickHouse next to the relational databases.

Query & export

A highlighted SQL Query editor or the data viewer shapes the rows, then every exit exports all of them.

Copies in place

Copy tables inside the same schema with names like {table}_copy.

Vectors & embeddings

pgvector, MySQL, MariaDB, Oracle, SQL Server, Db2, DuckDB and ClickHouse vectors keep their dimensions, HNSW and IVF indexes keep their distances.

From vector databases

Milvus, Qdrant, Weaviate, Pinecone, Elasticsearch, OpenSearch and Chroma in the tree: databases, collections, partitions and tenants, records page by page, imported into tables of ids, vectors, fields and the payload as JSON. SQL on Elasticsearch and OpenSearch exports the rows of indexes like tables.

Column mapping

Rename a column, give it a type of the target or leave it out, keys and indexes follow, other columns stay as they are.

SSH tunnels

Reach a database behind a bastion host with a password or a private key, host keys trusted on first use.

Info, health & dashboard

Server, driver, session and the health of a data source or a vector database, and live charts of sessions, transactions, rows, cache, locks, CPU and memory.

Values & rows

Double click a cell for its whole value, copy selected rows as CSV, TSV, JSON or Markdown, filter the data sources of the tree.

How it works

Read once, generate for any target

SqlJam builds a metadata tree of the source, renders it with the dialect of the target type and version, then streams rows to a database or an export package.

Architecture: source database, metadata tree, target dialect, then direct import or export package and package import
1

Metadata: per-database operations read tables, keys, indexes, comments, partitions and sequences.

2

Dialect: DbType.createDialect(major, minor) picks e.g. Oracle11gDialect.

3

Rows: counted, paged by primary key, normalized and written in batches, or written to Parquet, CSV or Excel by an embedded DuckDB.

4

Vector databases: a line of its own. REST clients read the collections, a visitor builds the tables and the pages go into a target whose vector features are probed first.

Quick start

Running in two minutes

Java 17 is all you need on Windows, macOS and Linux. JavaFX and every JDBC driver are bundled.

bash
git clone git@github.com:paganini2008/sqljam.git && cd sqljam
./mvnw -DskipTests package       # Windows: mvnw.cmd, output goes to bin/
bin/sqljam.sh                    # Windows: bin\sqljam.bat, or double click the jar of your platform

Or use the API

java
// MySQL database → PostgreSQL export package
ScriptExporter exporter = new ScriptExporter(new File("export"), false);
Exporter.ExportConfiguration config = exporter.getConfiguration();
config.setDbType(DbType.MYSQL);
config.setUrl(DbType.MYSQL.getUrl("localhost", 3306, "shop"));
config.setUsername("root");
config.setPassword("secret");
exporter.setTargetDbType(DbType.POSTGRESQL);
exporter.exportDdlAndData();

Result

export/
├── schema.sql
├── data.sql            # data_2.sql … above 10 MB
├── lob/
│   └── document/000001_content.clob
├── lob-manifest.json
├── constraints.sql     # foreign keys, after data
└── manifest.json       # source, target, sha256, rows
Use cases

Ways to move a table

Export wizard

Pick tables, choose the target type and version, one file per table or a single data.sql, and whether LOBs go into files.

exporter.setTargetDbType(DbType.ORACLE);
exporter.setTargetVersion(11, 2);   // sequences + triggers
Progress dialog

Copy straight into another data source, or create one on the spot with the + button next to it. Target schemas are created, identities continue from the imported max value.

target.setDbType(DbType.SQLSERVER);
target.setTargetSchemaName("hr");   // created if missing
importer.exportDdlAndData();
Import package dialog

The manifest decides: only data sources of the exported target type are offered, files are checked by SHA-256 and run in order.

ScriptImporter importer = new ScriptImporter(connection, DbType.POSTGRESQL);
importer.importDirectory(new File("export"));
SQL Query editor with a highlighted join and its first rows

Write any SQL in the highlighted SQL Query editor, check the first rows, then export all rows of the query as a table. The data viewer narrows one table with columns, WHERE, GROUP BY and ORDER BY the same way.

source.getQueries().put("order_summary",
        "SELECT c.name, SUM(o.amount) AS amount FROM orders o JOIN customers c ...");
source.getTableQueries().put("EMPLOYEES", new TableQuery(columns,
        "SALARY > 1000", null, "SALARY DESC"));
Package viewer with a Parquet file

Export packages of Parquet, CSV or Excel files, look inside them with sizes, times and previews, and load Parquet, CSV or Excel files of other tools into any table, an Excel sheet without manifest.json too.

parquet.setCompression("ZSTD");
parquet.exportDdlAndData();   // data/<table>.parquet
csv.setDelimiter(";");
csv.exportDdlAndData();       // data/<table>.csv, <table>_2.csv ...
excel.exportDdlAndData();     // data/<table>.xlsx, one sheet with a header row
importer.importFiles(files, "sales", ParquetImporter.Mode.CREATE);
Import from Vector Database dialog with collections, fields, a previewed query and a target with vectors

Add a vector database as a data source, expand it in the tree to its databases, collections and partitions, page through the records of conditions, a native filter or a nearest neighbor search, and import the collections into a data source with vectors. Only such data sources are offered as targets. On Elasticsearch and OpenSearch, SQL Query reads the indexes and exports the rows of a query like a table.

configuration.addCollection("docs", "docs");
configuration.setQuery(VdbQuery.all().where("lang = 'en'"));
new VdbExporter(client, dataSource, configuration).export();   // id, embedding vector(1024), payload jsonb
Map Columns dialog with a renamed column, a type of the target and a column left out

Map Columns renames a column, gives it a type of the target or leaves it out, for tables and for the fields of vector collections. Keys, indexes and foreign keys follow the new names, the other columns are imported as they are.

orders.put("NOTE", new ColumnMapping("REMARK", "TEXT", false));
orders.put("SECRET", ColumnMapping.skip());   // not imported
target.getColumnMappings().put("ORDERS", orders);
Migration report with its status, summary and the tables checked against the target

Every import and export leaves a migration report, also when it fails or is cancelled: rows of each table counted again in the target, skipped rows with their errors, created objects and where it stopped. Transfer > Import History lists every report, View Report opens one, Export writes it as Markdown, HTML or JSON.

~/.sqljam/reports/20261025-134910-9fec1f3e.json
Completed · 3 tables · 263 rows written · 0 skipped
sjm_emp   250 → 250 ✓
Sync Tasks with a task which ran and a task every night

Sync tasks copy the rows which changed since the last run, by a column of the update time or an increasing key, every N minutes or every day. SqlJam runs them while it is open. Copy Command gives the command line of a task for a cron or the Task Scheduler of your own, SqlJam never changes the scheduler of your system. Vector collections sync too, every run leaves a report.

sqljam.sh sync --list
sqljam.sh sync --task "Shop to PostgreSQL"
sqljam.sh sync --due   # one line of cron for every task
Dashboard of a MySQL data source with live charts of threads, statements, network and buffer pool hits

Info > Dashboard draws live charts of the last 5 minutes: sessions, transactions, statements, rows, cache hits, locks, network, CPU and memory, read from the statistics of each database. Vector databases show their collections and records, Elasticsearch and OpenSearch also CPU, heap, indexing and searches, Qdrant requests and memory. Metrics which a server does not tell are listed with the reason.

Sample every 1, 2, 5, 10 or 30 s · Pause · Resume
Performance

Tens of thousands of rows per second

81.0krows/s · H2 → SQL package
100%cross-database pairs pass
SQL · Parquet · CSV · Excelexport package formats
Upsertupdate or skip rows by key
Throughput chart
Scenario (200,000 rows × 6 columns)TimeRows/s
H2 → MySQL9.9 s20.2k
H2 → MariaDB7.7 s26.0k
H2 → PostgreSQL6.9 s28.8k
H2 → Oracle4.8 s41.6k
H2 → SQL Server13.3 s15.1k
H2 → Db210.7 s18.7k
H2 → ClickHouse5.4 s36.8k
H2 → DuckDB5.4 s37.2k
H2 → SQL package2.5 s81.0k
H2 → Parquet package5.8 s34.6k
H2 → CSV package5.5 s36.7k
SQL package → PostgreSQL10.1 s19.8k
Qdrant → PostgreSQL (20,000 points, 256-d vectors and payload)18.3 s1.1k

Environment: Apple M2 Max, 32 GB, JDK 17 · databases in Docker on a server of the local network, H2, DuckDB and the packages local · default settings.

Documentation

Learn more

Open source

Built in the open