Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-sqlite3-to-mysql for
openSUSE:Factory checked in at 2026-10-26 10:19:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sqlite3-to-mysql (Old)
and /work/SRC/openSUSE:Factory/.python-sqlite3-to-mysql.new.2252680 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sqlite3-to-mysql"
Mon Oct 26 10:19:53 2026 rev:10 rq:1392625 version:2.6.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-sqlite3-to-mysql/python-sqlite3-to-mysql.changes
2026-05-20 15:25:52.809499008 +0200
+++
/work/SRC/openSUSE:Factory/.python-sqlite3-to-mysql.new.2252680/python-sqlite3-to-mysql.changes
2026-10-26 10:20:04.196182417 +0100
@@ -1,0 +2,11 @@
+Mon Oct 26 07:02:12 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 2.6.1:
+ * [FEAT] add MySQL 9.7 support
+ * [DOCS] clarify project usage and update MySQL 9.7
+ documentation
+ * [CHORE] stop upgrading pip during Docker image builds
+ * [CHORE] update GitHub Actions dependencies
+ * [TEST] add MySQL 9.7 test coverage
+
+-------------------------------------------------------------------
Old:
----
sqlite3_to_mysql-2.6.0.tar.gz
New:
----
sqlite3_to_mysql-2.6.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-sqlite3-to-mysql.spec ++++++
--- /var/tmp/diff_new_pack.xO4Avo/_old 2026-10-26 10:20:05.567239839 +0100
+++ /var/tmp/diff_new_pack.xO4Avo/_new 2026-10-26 10:20:05.568239881 +0100
@@ -22,7 +22,7 @@
%bcond_with libalternatives
%endif
Name: python-sqlite3-to-mysql
-Version: 2.6.0
+Version: 2.6.1
Release: 0
Summary: A Python tool to transfer data from SQLite 3 to MySQL
License: MIT
++++++ sqlite3_to_mysql-2.6.0.tar.gz -> sqlite3_to_mysql-2.6.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sqlite3_to_mysql-2.6.0/.gitignore
new/sqlite3_to_mysql-2.6.1/.gitignore
--- old/sqlite3_to_mysql-2.6.0/.gitignore 2020-02-02 01:00:00.000000000
+0100
+++ new/sqlite3_to_mysql-2.6.1/.gitignore 2020-02-02 01:00:00.000000000
+0100
@@ -111,4 +111,10 @@
# Potential leftovers
tests/db_credentials.json
-test.db
\ No newline at end of file
+test.db
+
+# AI related
+.junie/
+
+# VS Code settings
+.history
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sqlite3_to_mysql-2.6.0/CHANGELOG.md
new/sqlite3_to_mysql-2.6.1/CHANGELOG.md
--- old/sqlite3_to_mysql-2.6.0/CHANGELOG.md 2020-02-02 01:00:00.000000000
+0100
+++ new/sqlite3_to_mysql-2.6.1/CHANGELOG.md 2020-02-02 01:00:00.000000000
+0100
@@ -1,3 +1,11 @@
+# 2.6.1
+
+* [FEAT] add MySQL 9.7 support
+* [DOCS] clarify project usage and update MySQL 9.7 documentation
+* [CHORE] stop upgrading pip during Docker image builds
+* [CHORE] update GitHub Actions dependencies
+* [TEST] add MySQL 9.7 test coverage
+
# 2.6.0
* [FEAT] add MySQL SSL certificate options `--mysql-ssl-ca`,
`--mysql-ssl-cert`, and `--mysql-ssl-key`,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sqlite3_to_mysql-2.6.0/PKG-INFO
new/sqlite3_to_mysql-2.6.1/PKG-INFO
--- old/sqlite3_to_mysql-2.6.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
+++ new/sqlite3_to_mysql-2.6.1/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 2.4
+Metadata-Version: 2.5
Name: sqlite3-to-mysql
-Version: 2.6.0
+Version: 2.6.1
Summary: A simple Python tool to transfer data from SQLite 3 to MySQL
Project-URL: Homepage, https://techouse.github.io/sqlite3-to-mysql/
Project-URL: Documentation, https://techouse.github.io/sqlite3-to-mysql/
@@ -71,11 +71,11 @@
[](https://pypistats.org/packages/sqlite3-to-mysql)
[](https://formulae.brew.sh/formula/sqlite3-to-mysql)
[](https://pypi.org/project/sqlite3-to-mysql/)
-[](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0+|+8.4&color=2b5d80)
-[](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.6+|+10.11+|+11.4+|+11.6+|+11.8&color=C0765A)
+[](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
+[](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
[](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)
[](CODE-OF-CONDUCT.md)
-[]((https://pypi.org/project/sqlite3-to-mysql/))
+[](https://pypi.org/project/sqlite3-to-mysql/)
[](https://github.com/ambv/black)
[](https://www.codacy.com/manual/techouse/sqlite3-to-mysql?utm_source=github.com&utm_medium=referral&utm_content=techouse/sqlite3-to-mysql&utm_campaign=Badge_Grade)
[](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
@@ -87,125 +87,273 @@
# SQLite3 to MySQL
-#### A simple Python tool to transfer data from SQLite 3 to MySQL.
+A Python CLI for transferring SQLite 3 schema and data to MySQL or MariaDB.
-### How to run
+`sqlite3mysql` reads the source schema from SQLite, creates equivalent
MySQL/MariaDB tables, indexes, foreign keys, and
+views where possible, then transfers table data into the target database.
+
+## Prerequisites
+
+- Python 3.9 or newer, unless you use the Docker image.
+- A readable SQLite 3 database file.
+- A reachable MySQL or MariaDB server.
+- A MySQL user that can connect, create the target database when it does not
exist, create tables and views, insert data,
+ add indexes, and add foreign keys.
+
+See the
+[GitHub Actions CI
matrix](https://github.com/techouse/sqlite3-to-mysql/blob/master/.github/workflows/test.yml)
for the
+current MySQL and MariaDB versions tested by the project. Very old server
versions are more likely to differ in type,
+default-value, JSON, FULLTEXT, or authentication behavior.
+
+## Installation
+
+Install from PyPI:
```bash
pip install sqlite3-to-mysql
sqlite3mysql --help
```
-### Usage
+On macOS, you can also install with Homebrew:
+
+```bash
+brew install sqlite3-to-mysql
+sqlite3mysql --help
+```
+
+Or run the published Docker image:
+
+```bash
+docker run --rm ghcr.io/techouse/sqlite3-to-mysql:latest --help
+```
+
+## Agent skill
+
+This repo includes an optional agent skill at
+[`skills/sqlite3-to-mysql/`](https://github.com/techouse/sqlite3-to-mysql/tree/master/skills/sqlite3-to-mysql)
for users who want Codex or another compatible agent to help prepare a safe
`sqlite3mysql` transfer command. The skill is user-facing: it focuses on
migration planning, CLI recipes, password-safe defaults, and MySQL/MariaDB
caveats.
+
+## Quick start
+
+Use `-p` / `--prompt-mysql-password` for interactive password entry. This
avoids putting the password in shell history
+or process listings.
+
+```bash
+sqlite3mysql \
+ --sqlite-file ./app.sqlite3 \
+ --mysql-database app_db \
+ --mysql-user app_user \
+ --prompt-mysql-password \
+ --mysql-host 127.0.0.1 \
+ --mysql-port 3306
+```
+
+Short options are equivalent:
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p -h 127.0.0.1 -P 3306
```
-Usage: sqlite3mysql [OPTIONS]
-Options:
- -f, --sqlite-file PATH SQLite3 database file [required]
- -t, --sqlite-tables TUPLE Transfer only these specific tables (space
- separated table names). Implies --without-
- foreign-keys which inhibits the transfer of
- foreign keys. Can not be used together with
- --exclude-sqlite-tables.
- -e, --exclude-sqlite-tables TUPLE
- Transfer all tables except these specific
- tables (space separated table names).
- Implies --without-foreign-keys which
- inhibits the transfer of foreign keys. Can
- not be used together with --sqlite-tables.
- -A, --sqlite-views-as-tables Materialize SQLite views as tables in MySQL
- instead of creating matching MySQL views
- (legacy behavior).
- -X, --without-foreign-keys Do not transfer foreign keys.
- -W, --ignore-duplicate-keys Ignore duplicate keys. The default behavior
- is to create new ones with a numerical
- suffix, e.g. 'exising_key' ->
- 'existing_key_1'
- -d, --mysql-database TEXT MySQL database name [required]
- -u, --mysql-user TEXT MySQL user [required]
- -p, --prompt-mysql-password Prompt for MySQL password
- --mysql-password TEXT MySQL password
- -h, --mysql-host TEXT MySQL host. Defaults to localhost.
- -P, --mysql-port INTEGER MySQL port. Defaults to 3306.
- -k, --mysql-socket PATH Path to MySQL unix socket file. Cannot be
- used with --mysql-ssl-* options.
- --mysql-ssl-ca PATH Path to SSL CA certificate file. Cannot be
- used with --mysql-socket or --skip-ssl.
- --mysql-ssl-cert PATH Path to SSL certificate file. Must be
- provided together with --mysql-ssl-key.
- Cannot be used with --mysql-socket or
- --skip-ssl.
- --mysql-ssl-key PATH Path to SSL key file. Must be provided
- together with --mysql-ssl-cert. Cannot be
- used with --mysql-socket or --skip-ssl.
- -S, --skip-ssl Disable MySQL connection encryption. Cannot
- be used with --mysql-ssl-* options.
- -i, --mysql-insert-method [DEFAULT|IGNORE|UPDATE]
- MySQL insert method. DEFAULT will throw
- errors when encountering duplicate records;
- UPDATE will update existing rows; IGNORE
- will ignore insert errors. Defaults to
- IGNORE.
- -E, --mysql-truncate-tables Truncates existing tables before inserting
- data.
- --mysql-integer-type TEXT MySQL default integer field type. Defaults
- to INT(11).
- --mysql-string-type TEXT MySQL default string field type. Defaults to
- VARCHAR(255).
- --mysql-text-type [LONGTEXT|MEDIUMTEXT|TEXT|TINYTEXT]
- MySQL default text field type. Defaults to
- TEXT.
- --mysql-charset TEXT MySQL database and table character set
- [default: utf8mb4]
- --mysql-collation TEXT MySQL database and table collation
- -T, --use-fulltext Use FULLTEXT indexes on TEXT columns. Will
- throw an error if your MySQL version does
- not support InnoDB FULLTEXT indexes!
- --with-rowid Transfer rowid columns.
- -c, --chunk INTEGER Chunk reading/writing SQL records
- -K, --mysql-skip-create-tables Skip creating tables in MySQL.
- -J, --mysql-skip-transfer-data Skip transferring data to MySQL.
- -l, --log-file PATH Log file
- -q, --quiet Quiet. Display only errors.
- --debug Debug mode. Will throw exceptions.
- --version Show the version and exit.
- --help Show this message and exit.
-```
-
-MySQL SSL note: when `--mysql-ssl-ca` is provided, MySQL Connector/Python
verifies the server
-certificate chain. `--mysql-ssl-cert` and `--mysql-ssl-key` enable client
certificate authentication.
-These options do not enable hostname identity verification. If you provide
only the client certificate
-and key without `--mysql-ssl-ca`, the server certificate is not verified.
+For automation, `--mysql-password` is available, but prefer a secret manager
or environment-expanded value rather than
+typing the password directly into your shell history. The password is still
passed as a command-line argument and may be
+visible through process listings or logs.
+
+## Common recipes
-#### Docker
+### Run with Docker
-If you don't want to install the tool on your system, you can use the Docker
image instead.
+Use `host.docker.internal` when the MySQL or MariaDB server is running on the
host machine and the Docker container needs
+to reach it. On Linux Docker Engine, add
`--add-host=host.docker.internal:host-gateway` before the image name if
+`host.docker.internal` is not resolvable.
```bash
docker run -it \
- --workdir $(pwd) \
- --volume $(pwd):$(pwd) \
- --rm ghcr.io/techouse/sqlite3-to-mysql:latest \
- --sqlite-file baz.db \
- --mysql-user foo \
- --mysql-password bar \
- --mysql-database baz \
- --mysql-host host.docker.internal
-```
-
-This will mount your host current working directory (pwd) inside the Docker
container as the current working directory.
-Any files Docker would write to the current working directory are written to
the host directory where you did docker
-run. Note that you have to also use a
-[special
hostname](https://docs.docker.com/desktop/networking/#use-cases-and-workarounds-for-all-platforms)
-`host.docker.internal`
-to access your host machine from inside the Docker container.
+ --rm \
+ --workdir "$PWD" \
+ --volume "$PWD:$PWD" \
+ ghcr.io/techouse/sqlite3-to-mysql:latest \
+ -f ./app.sqlite3 \
+ -d app_db \
+ -u app_user \
+ -p \
+ -h host.docker.internal
+```
+
+Files inside the mounted working directory are shared with the host.
-#### Homebrew
+### Transfer schema only
-If you're on macOS, you can install the tool using
[Homebrew](https://brew.sh/).
+Create the MySQL tables, indexes, views, and foreign keys without transferring
table rows.
```bash
-brew install sqlite3-to-mysql
-sqlite3mysql --help
+sqlite3mysql -f ./schema.sqlite3 -d app_db -u app_user -p
--mysql-skip-transfer-data
+```
+
+### Transfer data into existing MySQL tables
+
+`--mysql-skip-create-tables` skips DDL creation and only inserts data. The
MySQL tables must already exist and be
+compatible with the SQLite source schema.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p
--mysql-skip-create-tables
+```
+
+### Transfer only some tables
+
+Table names are space-separated and are consumed until the next CLI option.
+
+```bash
+sqlite3mysql -f ./subset.sqlite3 -d app_db -u app_user -p --sqlite-tables
users orders invoices
```
+
+Transfer everything except selected tables:
+
+```bash
+sqlite3mysql -f ./subset.sqlite3 -d app_db -u app_user -p
--exclude-sqlite-tables audit_log temp_imports
+```
+
+Selecting or excluding tables disables foreign key transfer because the
referenced tables may not be present.
+
+### Refresh existing target tables
+
+`--mysql-truncate-tables` deletes rows from matching target tables before
inserting data.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-truncate-tables
+```
+
+Use `--mysql-insert-method UPDATE` to update existing rows when inserts hit
duplicate keys.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-insert-method
UPDATE
+```
+
+### Use a Unix socket
+
+Use a socket instead of TCP when the MySQL server is local and configured for
socket connections.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-socket
/var/run/mysqld/mysqld.sock
+```
+
+### Use SSL certificates
+
+Verify the server certificate with a CA file:
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-ssl-ca
/path/to/ca.pem
+```
+
+Use a client certificate and key:
+
+```bash
+sqlite3mysql \
+ -f ./app.sqlite3 \
+ -d app_db \
+ -u app_user \
+ -p \
+ --mysql-ssl-ca /path/to/ca.pem \
+ --mysql-ssl-cert /path/to/client-cert.pem \
+ --mysql-ssl-key /path/to/client-key.pem
+```
+
+Use `--skip-ssl` only when you explicitly need to disable MySQL connection
encryption.
+
+### Tune large transfers and logs
+
+Use `--chunk` to tune the number of SQLite rows read at a time. Use `--quiet`
to suppress progress output and
+`--log-file` to write logs to a file.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --chunk 50000 --quiet
--log-file transfer.log
+```
+
+## Options at a glance
+
+| Option | Purpose |
+| --- | --- |
+| `-f`, `--sqlite-file PATH` | Source SQLite database file. Required. |
+| `-d`, `--mysql-database TEXT` | Target MySQL/MariaDB database name.
Required. |
+| `-u`, `--mysql-user TEXT` | MySQL/MariaDB user. Required. |
+| `-p`, `--prompt-mysql-password` | Prompt for the MySQL password. Preferred
for interactive use. |
+| `--mysql-password TEXT` | Provide the MySQL password directly. Useful for
automation, but handle carefully. |
+| `-h`, `--mysql-host TEXT` | MySQL host. Defaults to `localhost`. |
+| `-P`, `--mysql-port INTEGER` | MySQL port. Defaults to `3306`. |
+| `-k`, `--mysql-socket PATH` | MySQL Unix socket path. Cannot be combined
with SSL certificate options. |
+| `-t`, `--sqlite-tables TUPLE` | Transfer only the listed tables. Implies no
foreign key transfer. |
+| `-e`, `--exclude-sqlite-tables TUPLE` | Transfer every table except the
listed tables. Implies no foreign key transfer. |
+| `-A`, `--sqlite-views-as-tables` | Materialize SQLite views as MySQL tables
instead of creating MySQL views. |
+| `-X`, `--without-foreign-keys` | Do not create foreign keys in MySQL. |
+| `-W`, `--ignore-duplicate-keys` | Skip duplicate SQLite index names instead
of renaming them with a numeric suffix. |
+| `-E`, `--mysql-truncate-tables` | Truncate matching target tables before
inserting data. |
+| `-K`, `--mysql-skip-create-tables` | Skip table/view creation and transfer
data only. |
+| `-J`, `--mysql-skip-transfer-data` | Create schema only and skip table data.
|
+| `-i`, `--mysql-insert-method [DEFAULT\|IGNORE\|UPDATE]` | Choose
duplicate-row insert behavior. Defaults to `IGNORE`. |
+| `--mysql-integer-type TEXT` | MySQL default integer column type. Defaults to
`INT(11)`. |
+| `--mysql-string-type TEXT` | MySQL default string column type. Defaults to
`VARCHAR(255)`. |
+| `--mysql-text-type [LONGTEXT\|MEDIUMTEXT\|TEXT\|TINYTEXT]` | MySQL default
text column type. Defaults to `TEXT`. |
+| `--mysql-charset TEXT` | MySQL database and table character set. Defaults to
`utf8mb4`. |
+| `--mysql-collation TEXT` | MySQL database and table collation. Must belong
to the selected charset. |
+| `--mysql-ssl-ca PATH` | Path to an SSL CA certificate file. |
+| `--mysql-ssl-cert PATH` | Path to an SSL client certificate file. Must be
paired with `--mysql-ssl-key`. |
+| `--mysql-ssl-key PATH` | Path to an SSL client key file. Must be paired with
`--mysql-ssl-cert`. |
+| `-S`, `--skip-ssl` | Disable MySQL connection encryption. Cannot be used
with SSL certificate options. |
+| `-T`, `--use-fulltext` | Use FULLTEXT indexes on text columns when the
target server supports InnoDB FULLTEXT. |
+| `--with-rowid` | Transfer SQLite `rowid` columns for tables that have
rowids. |
+| `-c`, `--chunk INTEGER` | Read and write SQL records in batches. |
+| `-l`, `--log-file PATH` | Write logs to a file. |
+| `-q`, `--quiet` | Show only errors after the initial command banner. |
+| `--debug` | Re-raise exceptions for debugging instead of printing friendly
errors. |
+| `--version` | Show environment and dependency versions. |
+| `--help` | Show CLI help. |
+
+## Combinations and caveats
+
+- `--sqlite-tables` and `--exclude-sqlite-tables` are mutually exclusive.
+- Either table filter (`--sqlite-tables` or `--exclude-sqlite-tables`)
automatically disables foreign key transfer.
+- `--mysql-skip-create-tables` and `--mysql-skip-transfer-data` cannot be used
together because there would be nothing to
+ do.
+- `--mysql-skip-create-tables` requires compatible target MySQL tables to
already exist.
+- `--mysql-truncate-tables` deletes rows from matching target tables before
inserting data.
+- `--mysql-socket` cannot be combined with `--mysql-ssl-ca`,
`--mysql-ssl-cert`, or `--mysql-ssl-key`.
+- `--skip-ssl` cannot be combined with `--mysql-ssl-ca`, `--mysql-ssl-cert`,
or `--mysql-ssl-key`.
+- `--mysql-ssl-cert` and `--mysql-ssl-key` must be provided together.
+- `--mysql-collation` must be valid for the selected `--mysql-charset`.
+- `--use-fulltext` fails before transfer starts when the target server does
not support InnoDB FULLTEXT indexes.
+- Native MySQL views are created by default. If a target table has the same
name as a SQLite view, that target table is
+ dropped before the MySQL view is created. Use `--sqlite-views-as-tables` for
the older materialized-table behavior.
+- Table, view, column, index, and constraint names are truncated to MySQL's
64-character identifier limit.
+- `--mysql-password` passes the password as a command-line argument. Prefer
`--prompt-mysql-password` for interactive use
+ and inject secrets through a secret manager or CI secret store for
automation.
+
+MySQL SSL note: when `--mysql-ssl-ca` is provided, MySQL Connector/Python
verifies the server certificate chain.
+`--mysql-ssl-cert` and `--mysql-ssl-key` enable client certificate
authentication. These options do not enable hostname
+identity verification. If you provide only the client certificate and key
without `--mysql-ssl-ca`, the server
+certificate is not verified.
+
+## MySQL, MariaDB, and SQLite notes
+
+- MySQL and MariaDB are similar but not identical. JSON behavior, expression
defaults, duplicate-key update SQL,
+ timestamp defaults, fractional seconds, and FULLTEXT support can differ by
server family and version.
+- SQLite `JSONB` maps to MySQL/MariaDB `JSON` only when the target supports
JSON: MySQL `>= 5.7.8` and MariaDB
+ `>= 10.2.7`. Otherwise it maps to the configured text type.
+- SQLite `JSONB` value conversion requires SQLite 3.45 or newer. With older
SQLite versions, JSONB columns can still be
+ selected, but the SQLite `json()` conversion function is not used during
transfer.
+- `--mysql-insert-method UPDATE` uses the MySQL `VALUES (...) AS __new__`
alias only on MySQL `>= 8.0.19`; MariaDB keeps
+ the older duplicate-key update form.
+- Expression defaults are supported on MySQL `>= 8.0.13` and MariaDB `>=
10.2.0`; older servers may require defaults to
+ be omitted or simplified.
+- `CURRENT_TIMESTAMP` defaults on `DATETIME` require MySQL `>= 5.6.5` or
MariaDB `>= 10.0.1`.
+- Fractional seconds require MySQL `>= 5.6.4` or MariaDB `>= 10.1.2`.
+- InnoDB FULLTEXT indexes require MySQL `>= 5.6.0` or MariaDB `>= 10.0.5`.
+- After transfer, verify schema details that are important to your
application, especially defaults, collations, JSONB
+ columns, views, and foreign keys.
+
+## Documentation
+
+- [Full documentation](https://techouse.github.io/sqlite3-to-mysql/)
+- [Changelog](CHANGELOG.md)
+- [Issue tracker](https://github.com/techouse/sqlite3-to-mysql/issues)
+
+## License
+
+SQLite3 to MySQL is released under the [MIT License](LICENSE).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sqlite3_to_mysql-2.6.0/README.md
new/sqlite3_to_mysql-2.6.1/README.md
--- old/sqlite3_to_mysql-2.6.0/README.md 2020-02-02 01:00:00.000000000
+0100
+++ new/sqlite3_to_mysql-2.6.1/README.md 2020-02-02 01:00:00.000000000
+0100
@@ -2,11 +2,11 @@
[](https://pypistats.org/packages/sqlite3-to-mysql)
[](https://formulae.brew.sh/formula/sqlite3-to-mysql)
[](https://pypi.org/project/sqlite3-to-mysql/)
-[](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0+|+8.4&color=2b5d80)
-[](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.6+|+10.11+|+11.4+|+11.6+|+11.8&color=C0765A)
+[](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
+[](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
[](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)
[](CODE-OF-CONDUCT.md)
-[]((https://pypi.org/project/sqlite3-to-mysql/))
+[](https://pypi.org/project/sqlite3-to-mysql/)
[](https://github.com/ambv/black)
[](https://www.codacy.com/manual/techouse/sqlite3-to-mysql?utm_source=github.com&utm_medium=referral&utm_content=techouse/sqlite3-to-mysql&utm_campaign=Badge_Grade)
[](https://github.com/techouse/sqlite3-to-mysql/actions/workflows/test.yml)
@@ -18,125 +18,273 @@
# SQLite3 to MySQL
-#### A simple Python tool to transfer data from SQLite 3 to MySQL.
+A Python CLI for transferring SQLite 3 schema and data to MySQL or MariaDB.
-### How to run
+`sqlite3mysql` reads the source schema from SQLite, creates equivalent
MySQL/MariaDB tables, indexes, foreign keys, and
+views where possible, then transfers table data into the target database.
+
+## Prerequisites
+
+- Python 3.9 or newer, unless you use the Docker image.
+- A readable SQLite 3 database file.
+- A reachable MySQL or MariaDB server.
+- A MySQL user that can connect, create the target database when it does not
exist, create tables and views, insert data,
+ add indexes, and add foreign keys.
+
+See the
+[GitHub Actions CI
matrix](https://github.com/techouse/sqlite3-to-mysql/blob/master/.github/workflows/test.yml)
for the
+current MySQL and MariaDB versions tested by the project. Very old server
versions are more likely to differ in type,
+default-value, JSON, FULLTEXT, or authentication behavior.
+
+## Installation
+
+Install from PyPI:
```bash
pip install sqlite3-to-mysql
sqlite3mysql --help
```
-### Usage
+On macOS, you can also install with Homebrew:
+
+```bash
+brew install sqlite3-to-mysql
+sqlite3mysql --help
+```
+
+Or run the published Docker image:
+
+```bash
+docker run --rm ghcr.io/techouse/sqlite3-to-mysql:latest --help
+```
+
+## Agent skill
+
+This repo includes an optional agent skill at
+[`skills/sqlite3-to-mysql/`](https://github.com/techouse/sqlite3-to-mysql/tree/master/skills/sqlite3-to-mysql)
for users who want Codex or another compatible agent to help prepare a safe
`sqlite3mysql` transfer command. The skill is user-facing: it focuses on
migration planning, CLI recipes, password-safe defaults, and MySQL/MariaDB
caveats.
+
+## Quick start
+
+Use `-p` / `--prompt-mysql-password` for interactive password entry. This
avoids putting the password in shell history
+or process listings.
+
+```bash
+sqlite3mysql \
+ --sqlite-file ./app.sqlite3 \
+ --mysql-database app_db \
+ --mysql-user app_user \
+ --prompt-mysql-password \
+ --mysql-host 127.0.0.1 \
+ --mysql-port 3306
+```
+
+Short options are equivalent:
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p -h 127.0.0.1 -P 3306
```
-Usage: sqlite3mysql [OPTIONS]
-Options:
- -f, --sqlite-file PATH SQLite3 database file [required]
- -t, --sqlite-tables TUPLE Transfer only these specific tables (space
- separated table names). Implies --without-
- foreign-keys which inhibits the transfer of
- foreign keys. Can not be used together with
- --exclude-sqlite-tables.
- -e, --exclude-sqlite-tables TUPLE
- Transfer all tables except these specific
- tables (space separated table names).
- Implies --without-foreign-keys which
- inhibits the transfer of foreign keys. Can
- not be used together with --sqlite-tables.
- -A, --sqlite-views-as-tables Materialize SQLite views as tables in MySQL
- instead of creating matching MySQL views
- (legacy behavior).
- -X, --without-foreign-keys Do not transfer foreign keys.
- -W, --ignore-duplicate-keys Ignore duplicate keys. The default behavior
- is to create new ones with a numerical
- suffix, e.g. 'exising_key' ->
- 'existing_key_1'
- -d, --mysql-database TEXT MySQL database name [required]
- -u, --mysql-user TEXT MySQL user [required]
- -p, --prompt-mysql-password Prompt for MySQL password
- --mysql-password TEXT MySQL password
- -h, --mysql-host TEXT MySQL host. Defaults to localhost.
- -P, --mysql-port INTEGER MySQL port. Defaults to 3306.
- -k, --mysql-socket PATH Path to MySQL unix socket file. Cannot be
- used with --mysql-ssl-* options.
- --mysql-ssl-ca PATH Path to SSL CA certificate file. Cannot be
- used with --mysql-socket or --skip-ssl.
- --mysql-ssl-cert PATH Path to SSL certificate file. Must be
- provided together with --mysql-ssl-key.
- Cannot be used with --mysql-socket or
- --skip-ssl.
- --mysql-ssl-key PATH Path to SSL key file. Must be provided
- together with --mysql-ssl-cert. Cannot be
- used with --mysql-socket or --skip-ssl.
- -S, --skip-ssl Disable MySQL connection encryption. Cannot
- be used with --mysql-ssl-* options.
- -i, --mysql-insert-method [DEFAULT|IGNORE|UPDATE]
- MySQL insert method. DEFAULT will throw
- errors when encountering duplicate records;
- UPDATE will update existing rows; IGNORE
- will ignore insert errors. Defaults to
- IGNORE.
- -E, --mysql-truncate-tables Truncates existing tables before inserting
- data.
- --mysql-integer-type TEXT MySQL default integer field type. Defaults
- to INT(11).
- --mysql-string-type TEXT MySQL default string field type. Defaults to
- VARCHAR(255).
- --mysql-text-type [LONGTEXT|MEDIUMTEXT|TEXT|TINYTEXT]
- MySQL default text field type. Defaults to
- TEXT.
- --mysql-charset TEXT MySQL database and table character set
- [default: utf8mb4]
- --mysql-collation TEXT MySQL database and table collation
- -T, --use-fulltext Use FULLTEXT indexes on TEXT columns. Will
- throw an error if your MySQL version does
- not support InnoDB FULLTEXT indexes!
- --with-rowid Transfer rowid columns.
- -c, --chunk INTEGER Chunk reading/writing SQL records
- -K, --mysql-skip-create-tables Skip creating tables in MySQL.
- -J, --mysql-skip-transfer-data Skip transferring data to MySQL.
- -l, --log-file PATH Log file
- -q, --quiet Quiet. Display only errors.
- --debug Debug mode. Will throw exceptions.
- --version Show the version and exit.
- --help Show this message and exit.
-```
-
-MySQL SSL note: when `--mysql-ssl-ca` is provided, MySQL Connector/Python
verifies the server
-certificate chain. `--mysql-ssl-cert` and `--mysql-ssl-key` enable client
certificate authentication.
-These options do not enable hostname identity verification. If you provide
only the client certificate
-and key without `--mysql-ssl-ca`, the server certificate is not verified.
+For automation, `--mysql-password` is available, but prefer a secret manager
or environment-expanded value rather than
+typing the password directly into your shell history. The password is still
passed as a command-line argument and may be
+visible through process listings or logs.
+
+## Common recipes
-#### Docker
+### Run with Docker
-If you don't want to install the tool on your system, you can use the Docker
image instead.
+Use `host.docker.internal` when the MySQL or MariaDB server is running on the
host machine and the Docker container needs
+to reach it. On Linux Docker Engine, add
`--add-host=host.docker.internal:host-gateway` before the image name if
+`host.docker.internal` is not resolvable.
```bash
docker run -it \
- --workdir $(pwd) \
- --volume $(pwd):$(pwd) \
- --rm ghcr.io/techouse/sqlite3-to-mysql:latest \
- --sqlite-file baz.db \
- --mysql-user foo \
- --mysql-password bar \
- --mysql-database baz \
- --mysql-host host.docker.internal
-```
-
-This will mount your host current working directory (pwd) inside the Docker
container as the current working directory.
-Any files Docker would write to the current working directory are written to
the host directory where you did docker
-run. Note that you have to also use a
-[special
hostname](https://docs.docker.com/desktop/networking/#use-cases-and-workarounds-for-all-platforms)
-`host.docker.internal`
-to access your host machine from inside the Docker container.
+ --rm \
+ --workdir "$PWD" \
+ --volume "$PWD:$PWD" \
+ ghcr.io/techouse/sqlite3-to-mysql:latest \
+ -f ./app.sqlite3 \
+ -d app_db \
+ -u app_user \
+ -p \
+ -h host.docker.internal
+```
+
+Files inside the mounted working directory are shared with the host.
-#### Homebrew
+### Transfer schema only
-If you're on macOS, you can install the tool using
[Homebrew](https://brew.sh/).
+Create the MySQL tables, indexes, views, and foreign keys without transferring
table rows.
```bash
-brew install sqlite3-to-mysql
-sqlite3mysql --help
+sqlite3mysql -f ./schema.sqlite3 -d app_db -u app_user -p
--mysql-skip-transfer-data
+```
+
+### Transfer data into existing MySQL tables
+
+`--mysql-skip-create-tables` skips DDL creation and only inserts data. The
MySQL tables must already exist and be
+compatible with the SQLite source schema.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p
--mysql-skip-create-tables
+```
+
+### Transfer only some tables
+
+Table names are space-separated and are consumed until the next CLI option.
+
+```bash
+sqlite3mysql -f ./subset.sqlite3 -d app_db -u app_user -p --sqlite-tables
users orders invoices
```
+
+Transfer everything except selected tables:
+
+```bash
+sqlite3mysql -f ./subset.sqlite3 -d app_db -u app_user -p
--exclude-sqlite-tables audit_log temp_imports
+```
+
+Selecting or excluding tables disables foreign key transfer because the
referenced tables may not be present.
+
+### Refresh existing target tables
+
+`--mysql-truncate-tables` deletes rows from matching target tables before
inserting data.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-truncate-tables
+```
+
+Use `--mysql-insert-method UPDATE` to update existing rows when inserts hit
duplicate keys.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-insert-method
UPDATE
+```
+
+### Use a Unix socket
+
+Use a socket instead of TCP when the MySQL server is local and configured for
socket connections.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-socket
/var/run/mysqld/mysqld.sock
+```
+
+### Use SSL certificates
+
+Verify the server certificate with a CA file:
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --mysql-ssl-ca
/path/to/ca.pem
+```
+
+Use a client certificate and key:
+
+```bash
+sqlite3mysql \
+ -f ./app.sqlite3 \
+ -d app_db \
+ -u app_user \
+ -p \
+ --mysql-ssl-ca /path/to/ca.pem \
+ --mysql-ssl-cert /path/to/client-cert.pem \
+ --mysql-ssl-key /path/to/client-key.pem
+```
+
+Use `--skip-ssl` only when you explicitly need to disable MySQL connection
encryption.
+
+### Tune large transfers and logs
+
+Use `--chunk` to tune the number of SQLite rows read at a time. Use `--quiet`
to suppress progress output and
+`--log-file` to write logs to a file.
+
+```bash
+sqlite3mysql -f ./app.sqlite3 -d app_db -u app_user -p --chunk 50000 --quiet
--log-file transfer.log
+```
+
+## Options at a glance
+
+| Option | Purpose |
+| --- | --- |
+| `-f`, `--sqlite-file PATH` | Source SQLite database file. Required. |
+| `-d`, `--mysql-database TEXT` | Target MySQL/MariaDB database name.
Required. |
+| `-u`, `--mysql-user TEXT` | MySQL/MariaDB user. Required. |
+| `-p`, `--prompt-mysql-password` | Prompt for the MySQL password. Preferred
for interactive use. |
+| `--mysql-password TEXT` | Provide the MySQL password directly. Useful for
automation, but handle carefully. |
+| `-h`, `--mysql-host TEXT` | MySQL host. Defaults to `localhost`. |
+| `-P`, `--mysql-port INTEGER` | MySQL port. Defaults to `3306`. |
+| `-k`, `--mysql-socket PATH` | MySQL Unix socket path. Cannot be combined
with SSL certificate options. |
+| `-t`, `--sqlite-tables TUPLE` | Transfer only the listed tables. Implies no
foreign key transfer. |
+| `-e`, `--exclude-sqlite-tables TUPLE` | Transfer every table except the
listed tables. Implies no foreign key transfer. |
+| `-A`, `--sqlite-views-as-tables` | Materialize SQLite views as MySQL tables
instead of creating MySQL views. |
+| `-X`, `--without-foreign-keys` | Do not create foreign keys in MySQL. |
+| `-W`, `--ignore-duplicate-keys` | Skip duplicate SQLite index names instead
of renaming them with a numeric suffix. |
+| `-E`, `--mysql-truncate-tables` | Truncate matching target tables before
inserting data. |
+| `-K`, `--mysql-skip-create-tables` | Skip table/view creation and transfer
data only. |
+| `-J`, `--mysql-skip-transfer-data` | Create schema only and skip table data.
|
+| `-i`, `--mysql-insert-method [DEFAULT\|IGNORE\|UPDATE]` | Choose
duplicate-row insert behavior. Defaults to `IGNORE`. |
+| `--mysql-integer-type TEXT` | MySQL default integer column type. Defaults to
`INT(11)`. |
+| `--mysql-string-type TEXT` | MySQL default string column type. Defaults to
`VARCHAR(255)`. |
+| `--mysql-text-type [LONGTEXT\|MEDIUMTEXT\|TEXT\|TINYTEXT]` | MySQL default
text column type. Defaults to `TEXT`. |
+| `--mysql-charset TEXT` | MySQL database and table character set. Defaults to
`utf8mb4`. |
+| `--mysql-collation TEXT` | MySQL database and table collation. Must belong
to the selected charset. |
+| `--mysql-ssl-ca PATH` | Path to an SSL CA certificate file. |
+| `--mysql-ssl-cert PATH` | Path to an SSL client certificate file. Must be
paired with `--mysql-ssl-key`. |
+| `--mysql-ssl-key PATH` | Path to an SSL client key file. Must be paired with
`--mysql-ssl-cert`. |
+| `-S`, `--skip-ssl` | Disable MySQL connection encryption. Cannot be used
with SSL certificate options. |
+| `-T`, `--use-fulltext` | Use FULLTEXT indexes on text columns when the
target server supports InnoDB FULLTEXT. |
+| `--with-rowid` | Transfer SQLite `rowid` columns for tables that have
rowids. |
+| `-c`, `--chunk INTEGER` | Read and write SQL records in batches. |
+| `-l`, `--log-file PATH` | Write logs to a file. |
+| `-q`, `--quiet` | Show only errors after the initial command banner. |
+| `--debug` | Re-raise exceptions for debugging instead of printing friendly
errors. |
+| `--version` | Show environment and dependency versions. |
+| `--help` | Show CLI help. |
+
+## Combinations and caveats
+
+- `--sqlite-tables` and `--exclude-sqlite-tables` are mutually exclusive.
+- Either table filter (`--sqlite-tables` or `--exclude-sqlite-tables`)
automatically disables foreign key transfer.
+- `--mysql-skip-create-tables` and `--mysql-skip-transfer-data` cannot be used
together because there would be nothing to
+ do.
+- `--mysql-skip-create-tables` requires compatible target MySQL tables to
already exist.
+- `--mysql-truncate-tables` deletes rows from matching target tables before
inserting data.
+- `--mysql-socket` cannot be combined with `--mysql-ssl-ca`,
`--mysql-ssl-cert`, or `--mysql-ssl-key`.
+- `--skip-ssl` cannot be combined with `--mysql-ssl-ca`, `--mysql-ssl-cert`,
or `--mysql-ssl-key`.
+- `--mysql-ssl-cert` and `--mysql-ssl-key` must be provided together.
+- `--mysql-collation` must be valid for the selected `--mysql-charset`.
+- `--use-fulltext` fails before transfer starts when the target server does
not support InnoDB FULLTEXT indexes.
+- Native MySQL views are created by default. If a target table has the same
name as a SQLite view, that target table is
+ dropped before the MySQL view is created. Use `--sqlite-views-as-tables` for
the older materialized-table behavior.
+- Table, view, column, index, and constraint names are truncated to MySQL's
64-character identifier limit.
+- `--mysql-password` passes the password as a command-line argument. Prefer
`--prompt-mysql-password` for interactive use
+ and inject secrets through a secret manager or CI secret store for
automation.
+
+MySQL SSL note: when `--mysql-ssl-ca` is provided, MySQL Connector/Python
verifies the server certificate chain.
+`--mysql-ssl-cert` and `--mysql-ssl-key` enable client certificate
authentication. These options do not enable hostname
+identity verification. If you provide only the client certificate and key
without `--mysql-ssl-ca`, the server
+certificate is not verified.
+
+## MySQL, MariaDB, and SQLite notes
+
+- MySQL and MariaDB are similar but not identical. JSON behavior, expression
defaults, duplicate-key update SQL,
+ timestamp defaults, fractional seconds, and FULLTEXT support can differ by
server family and version.
+- SQLite `JSONB` maps to MySQL/MariaDB `JSON` only when the target supports
JSON: MySQL `>= 5.7.8` and MariaDB
+ `>= 10.2.7`. Otherwise it maps to the configured text type.
+- SQLite `JSONB` value conversion requires SQLite 3.45 or newer. With older
SQLite versions, JSONB columns can still be
+ selected, but the SQLite `json()` conversion function is not used during
transfer.
+- `--mysql-insert-method UPDATE` uses the MySQL `VALUES (...) AS __new__`
alias only on MySQL `>= 8.0.19`; MariaDB keeps
+ the older duplicate-key update form.
+- Expression defaults are supported on MySQL `>= 8.0.13` and MariaDB `>=
10.2.0`; older servers may require defaults to
+ be omitted or simplified.
+- `CURRENT_TIMESTAMP` defaults on `DATETIME` require MySQL `>= 5.6.5` or
MariaDB `>= 10.0.1`.
+- Fractional seconds require MySQL `>= 5.6.4` or MariaDB `>= 10.1.2`.
+- InnoDB FULLTEXT indexes require MySQL `>= 5.6.0` or MariaDB `>= 10.0.5`.
+- After transfer, verify schema details that are important to your
application, especially defaults, collations, JSONB
+ columns, views, and foreign keys.
+
+## Documentation
+
+- [Full documentation](https://techouse.github.io/sqlite3-to-mysql/)
+- [Changelog](CHANGELOG.md)
+- [Issue tracker](https://github.com/techouse/sqlite3-to-mysql/issues)
+
+## License
+
+SQLite3 to MySQL is released under the [MIT License](LICENSE).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sqlite3_to_mysql-2.6.0/src/sqlite3_to_mysql/__init__.py
new/sqlite3_to_mysql-2.6.1/src/sqlite3_to_mysql/__init__.py
--- old/sqlite3_to_mysql-2.6.0/src/sqlite3_to_mysql/__init__.py 2020-02-02
01:00:00.000000000 +0100
+++ new/sqlite3_to_mysql-2.6.1/src/sqlite3_to_mysql/__init__.py 2020-02-02
01:00:00.000000000 +0100
@@ -1,5 +1,5 @@
"""Utility to transfer data from SQLite 3 to MySQL."""
-__version__ = "2.6.0"
+__version__ = "2.6.1"
from .transporter import SQLite3toMySQL
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/sqlite3_to_mysql-2.6.0/src/sqlite3_to_mysql/cli.py
new/sqlite3_to_mysql-2.6.1/src/sqlite3_to_mysql/cli.py
--- old/sqlite3_to_mysql-2.6.0/src/sqlite3_to_mysql/cli.py 2020-02-02
01:00:00.000000000 +0100
+++ new/sqlite3_to_mysql-2.6.1/src/sqlite3_to_mysql/cli.py 2020-02-02
01:00:00.000000000 +0100
@@ -62,7 +62,7 @@
"--ignore-duplicate-keys",
is_flag=True,
help="Ignore duplicate keys. The default behavior is to create new ones
with a numerical suffix, e.g. "
- "'exising_key' -> 'existing_key_1'",
+ "'existing_key' -> 'existing_key_1'",
)
@click.option("-d", "--mysql-database", default=None, help="MySQL database
name", required=True)
@click.option("-u", "--mysql-user", default=None, help="MySQL user",
required=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/sqlite3_to_mysql-2.6.0/tests/unit/mysql_utils_test.py
new/sqlite3_to_mysql-2.6.1/tests/unit/mysql_utils_test.py
--- old/sqlite3_to_mysql-2.6.0/tests/unit/mysql_utils_test.py 2020-02-02
01:00:00.000000000 +0100
+++ new/sqlite3_to_mysql-2.6.1/tests/unit/mysql_utils_test.py 2020-02-02
01:00:00.000000000 +0100
@@ -25,6 +25,7 @@
("5.7.8", Version("5.7.8")),
("8.0.0", Version("8.0.0")),
("9.0.0", Version("9.0.0")),
+ ("9.7.0", Version("9.7.0")),
("10.2.6-mariadb", Version("10.2.6")),
("10.2.7-mariadb", Version("10.2.7")),
("11.4.0-mariadb", Version("11.4.0")),
@@ -40,6 +41,7 @@
("5.7.8", True),
("8.0.0", True),
("9.0.0", True),
+ ("9.7.0", True),
("10.2.6-mariadb", False),
("10.2.7-mariadb", True),
("11.4.0-mariadb", True),
@@ -56,6 +58,7 @@
("8.0.18", False),
("8.0.19", True),
("9.0.0", True),
+ ("9.7.0", True),
("10.2.6-mariadb", False),
("10.2.7-mariadb", False),
("11.4.0-mariadb", False),
@@ -71,6 +74,7 @@
("5.5.0", False),
("5.6.0", True),
("8.0.0", True),
+ ("9.7.0", True),
("10.0.4-mariadb", False),
("10.0.5-mariadb", True),
("10.2.6-mariadb", True),
@@ -221,6 +225,7 @@
("8.0.12", False),
("8.0.13", True),
("8.0.13-8ubuntu1", True),
+ ("9.7.0", True),
("5.7.44", False),
],
)
@@ -248,6 +253,7 @@
("5.6.4", False),
("5.6.5", True),
("5.6.5-ps-log", True),
+ ("9.7.0", True),
("5.5.62", False),
],
)
@@ -274,6 +280,7 @@
("5.6.3", False),
("5.6.4", True),
("5.7.44-0ubuntu0.18.04.1", True),
+ ("9.7.0", True),
],
)
def test_fractional_seconds_mysql(self, ver: str, expected: bool) -> None: