X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fmysql2sql.rst;h=ec3062bbf1b3234b403d0744d67f0eb58998f857;hb=433f46b3a387ec5d4daf2c057923c6d4c1bc263a;hp=aba493eed1522dab52c31d700bf3edeb365a018d;hpb=159b4e3d7127e719a0dd12013dd54bf05b276ba9;p=sqlconvert.git diff --git a/docs/mysql2sql.rst b/docs/mysql2sql.rst index aba493e..ec3062b 100644 --- a/docs/mysql2sql.rst +++ b/docs/mysql2sql.rst @@ -1,16 +1,15 @@ -.. mysql2sql documentation master file, created by - sphinx-quickstart on Fri Jul 22 19:32:24 2016. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to mysql2sql's documentation! -===================================== +mysql2sql +========= This is mysql2sql, a mysql to sql converter. It is primary intended to convert mysqldump (especially with extended INSERT syntax) to standard SQL to load at least to PostgreSQL or SQLite. -The program is in its initial phase and currently cannot do much. +The program is in the early stage of development and currently cannot do much. +It removes /\*! directives \*/, unquotes names quoted with backticks, quote +non-lowercase names with double quotes, unescapes strings and escapes them to a +different quoting style, and passes everything else unmodified. + .. highlight:: none @@ -22,7 +21,7 @@ mysql2sql Usage:: - mysql2sql [-e encoding] [-E output_encoding] [infile] [[-o] outfile] + mysql2sql [-e encoding] [-E output_encoding] [-m/-p/-s] [infile] [[-o] outfile] Options:: @@ -32,10 +31,21 @@ Options:: separate output encoding, default is the same as `-e` except for console; for console output charset from the current locale is used + -m, --mysql MySQL/MariaDB quoting style + -p, --pg, --postgres PostgreSQL quoting style + -s, --sqlite Generic SQL/SQLite quoting style (default) -P, --no-pbar Inhibit progress bar infile Input file, stdin if absent or '-' -o, --outfile outfile Output file, stdout if absent or '-' +Options `-m/-p/-s` change quoting style. `-m` sets MySQL quoting style; it's +added to use the program in the following scenario: convert MySQL dumps with +extended INSERTs to SQL with plain INSERTS suitable to be fed back to MySQL. +`-p` sets PostgreSQL quoting style; it's like MySQL with additional `E''-style +quoting +`_. +`-s` sets generic SQL/SQLite quoting style; this is the default. + If stderr is connected to the console the program displays a text mode progress bar. Option `-P/--no-pbar` inhibits it.