Chapter 11: Cross-Dialect Migration
Info: This chapter explains cross-dialect schema/data transfer between MySQL, PostgreSQL and SQLite, plus dialect detection when importing SQL files.
In this chapter:
11.1 Cross-Dialect Transfer
SQLOZ offers a cross-dialect schema/data transfer matrix between MySQL, PostgreSQL and SQLite through the Transfer Database workflow:
- MySQL → SQLite or PostgreSQL
- PostgreSQL → MySQL or SQLite
- SQLite → MySQL or PostgreSQL
The transfer engine generates target-dialect DDL and literals, handles supported quotation and type mappings, orders tables for foreign-key-safe creation, and copies data in bounded pages. Vendor-specific or unsupported definitions can still require review.
Tip: Use the generated preview and target-side validation instead of assuming that arbitrary vendor SQL can be translated losslessly. This workflow is schema/data transfer; it is not a guarantee that every dialect-specific SQL statement will transpile.
11.2 Smart Import (Dialect Sniffer)
If you have a .sql file from another database, the dialect in which it was written may differ from that of the database you are connected to.
- Open File → Import SQL Script… (
Cmd + Shift + I). - Select your
.sqlfile. - SQLOZ automatically detects the file structure (Dialect Sniffer). If there is a dialect mismatch, it shows this warning:
Warning: The file you are trying to load is in the MySQL dialect, while your connected database is PostgreSQL.
- Check Auto-Transpile to Target Dialect and continue with Start Import.
- While reading the file, SQLOZ converts supported table definitions, literals and quoting to the target dialect and imports them. Unsupported or vendor-specific statements can still require review.