summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-sqlite3-to-mysql.spec338
-rw-r--r--sources1
3 files changed, 340 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..0b4ffa2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sqlite3-to-mysql-1.4.16.tar.gz
diff --git a/python-sqlite3-to-mysql.spec b/python-sqlite3-to-mysql.spec
new file mode 100644
index 0000000..91adaa5
--- /dev/null
+++ b/python-sqlite3-to-mysql.spec
@@ -0,0 +1,338 @@
+%global _empty_manifest_terminate_build 0
+Name: python-sqlite3-to-mysql
+Version: 1.4.16
+Release: 1
+Summary: A simple Python tool to transfer data from SQLite 3 to MySQL
+License: MIT
+URL: https://github.com/techouse/sqlite3-to-mysql
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a6/f2/a5626e7ad017978edd4bfaa93f777c96afd6fb0fdc97aa0b444621e87cda/sqlite3-to-mysql-1.4.16.tar.gz
+BuildArch: noarch
+
+Requires: python3-pytimeparse
+Requires: python3-six
+Requires: python3-simplejson
+Requires: python3-tqdm
+Requires: python3-packaging
+Requires: python3-tabulate
+Requires: python3-Unidecode
+Requires: python3-Click
+Requires: python3-mysql-connector-python
+Requires: python3-backports-datetime-fromisoformat
+Requires: python3-tabulate
+Requires: python3-Unidecode
+Requires: python3-Click
+Requires: python3-mysql-connector-python
+
+%description
+[![PyPI](https://img.shields.io/pypi/v/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
+[![Downloads](https://pepy.tech/badge/sqlite3-to-mysql)](https://pepy.tech/project/sqlite3-to-mysql)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
+[![MySQL Support](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.6+|+5.7+|+8.0&color=2b5d80)
+[![MariaDB Support](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5+|+10.6&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5&color=C0765A)
+[![GitHub license](https://img.shields.io/github/license/techouse/sqlite3-to-mysql)](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)
+[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE-OF-CONDUCT.md)
+[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
+[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d33b59d35b924711aae9418741a923ae)](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)
+[![Build Status](https://github.com/techouse/sqlite3-to-mysql/workflows/Test/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions?query=workflow%3ATest)
+[![codecov](https://codecov.io/gh/techouse/sqlite3-to-mysql/branch/master/graph/badge.svg)](https://codecov.io/gh/techouse/sqlite3-to-mysql)
+[![GitHub stars](https://img.shields.io/github/stars/techouse/sqlite3-to-mysql.svg?style=social&label=Star&maxAge=2592000)](https://github.com/techouse/sqlite3-to-mysql/stargazers)
+
+
+# SQLite3 to MySQL
+
+#### A simple Python tool to transfer data from SQLite 3 to MySQL.
+
+I originally wrote this simple program as a standalone script and published it
+as a [gist](https://gist.github.com/techouse/4deb94eee58a02d104c6) as an answer
+to this [Stack Overflow question](https://stackoverflow.com/questions/18671/quick-easy-way-to-migrate-sqlite3-to-mysql/32243979#32243979).
+Since then quite some people have taken interest in it since it's so simple and
+effective. Therefore I finally moved my lazy bones and made a GitHub repository :octopus:.
+
+### How to run
+
+```bash
+pip install sqlite3-to-mysql
+sqlite3mysql --help
+```
+
+### Usage
+```
+Usage: sqlite3mysql [OPTIONS]
+
+ Transfer SQLite to MySQL using the provided CLI 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.
+ -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.
+ -S, --skip-ssl Disable MySQL connection encryption.
+ -i, --mysql-insert-method [UPDATE|IGNORE|DEFAULT]
+ 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 [MEDIUMTEXT|TEXT|TINYTEXT|LONGTEXT]
+ 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
+ -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.
+```
+
+
+%package -n python3-sqlite3-to-mysql
+Summary: A simple Python tool to transfer data from SQLite 3 to MySQL
+Provides: python-sqlite3-to-mysql
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-sqlite3-to-mysql
+[![PyPI](https://img.shields.io/pypi/v/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
+[![Downloads](https://pepy.tech/badge/sqlite3-to-mysql)](https://pepy.tech/project/sqlite3-to-mysql)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
+[![MySQL Support](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.6+|+5.7+|+8.0&color=2b5d80)
+[![MariaDB Support](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5+|+10.6&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5&color=C0765A)
+[![GitHub license](https://img.shields.io/github/license/techouse/sqlite3-to-mysql)](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)
+[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE-OF-CONDUCT.md)
+[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
+[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d33b59d35b924711aae9418741a923ae)](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)
+[![Build Status](https://github.com/techouse/sqlite3-to-mysql/workflows/Test/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions?query=workflow%3ATest)
+[![codecov](https://codecov.io/gh/techouse/sqlite3-to-mysql/branch/master/graph/badge.svg)](https://codecov.io/gh/techouse/sqlite3-to-mysql)
+[![GitHub stars](https://img.shields.io/github/stars/techouse/sqlite3-to-mysql.svg?style=social&label=Star&maxAge=2592000)](https://github.com/techouse/sqlite3-to-mysql/stargazers)
+
+
+# SQLite3 to MySQL
+
+#### A simple Python tool to transfer data from SQLite 3 to MySQL.
+
+I originally wrote this simple program as a standalone script and published it
+as a [gist](https://gist.github.com/techouse/4deb94eee58a02d104c6) as an answer
+to this [Stack Overflow question](https://stackoverflow.com/questions/18671/quick-easy-way-to-migrate-sqlite3-to-mysql/32243979#32243979).
+Since then quite some people have taken interest in it since it's so simple and
+effective. Therefore I finally moved my lazy bones and made a GitHub repository :octopus:.
+
+### How to run
+
+```bash
+pip install sqlite3-to-mysql
+sqlite3mysql --help
+```
+
+### Usage
+```
+Usage: sqlite3mysql [OPTIONS]
+
+ Transfer SQLite to MySQL using the provided CLI 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.
+ -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.
+ -S, --skip-ssl Disable MySQL connection encryption.
+ -i, --mysql-insert-method [UPDATE|IGNORE|DEFAULT]
+ 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 [MEDIUMTEXT|TEXT|TINYTEXT|LONGTEXT]
+ 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
+ -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.
+```
+
+
+%package help
+Summary: Development documents and examples for sqlite3-to-mysql
+Provides: python3-sqlite3-to-mysql-doc
+%description help
+[![PyPI](https://img.shields.io/pypi/v/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
+[![Downloads](https://pepy.tech/badge/sqlite3-to-mysql)](https://pepy.tech/project/sqlite3-to-mysql)
+[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/sqlite3-to-mysql)](https://pypi.org/project/sqlite3-to-mysql/)
+[![MySQL Support](https://img.shields.io/static/v1?label=MySQL&message=5.5+|+5.6+|+5.7+|+8.0&color=2b5d80)](https://img.shields.io/static/v1?label=MySQL&message=5.6+|+5.7+|+8.0&color=2b5d80)
+[![MariaDB Support](https://img.shields.io/static/v1?label=MariaDB&message=5.5+|+10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5+|+10.6&color=C0765A)](https://img.shields.io/static/v1?label=MariaDB&message=10.0+|+10.1+|+10.2+|+10.3+|+10.4+|+10.5&color=C0765A)
+[![GitHub license](https://img.shields.io/github/license/techouse/sqlite3-to-mysql)](https://github.com/techouse/sqlite3-to-mysql/blob/master/LICENSE)
+[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE-OF-CONDUCT.md)
+[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
+[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d33b59d35b924711aae9418741a923ae)](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)
+[![Build Status](https://github.com/techouse/sqlite3-to-mysql/workflows/Test/badge.svg)](https://github.com/techouse/sqlite3-to-mysql/actions?query=workflow%3ATest)
+[![codecov](https://codecov.io/gh/techouse/sqlite3-to-mysql/branch/master/graph/badge.svg)](https://codecov.io/gh/techouse/sqlite3-to-mysql)
+[![GitHub stars](https://img.shields.io/github/stars/techouse/sqlite3-to-mysql.svg?style=social&label=Star&maxAge=2592000)](https://github.com/techouse/sqlite3-to-mysql/stargazers)
+
+
+# SQLite3 to MySQL
+
+#### A simple Python tool to transfer data from SQLite 3 to MySQL.
+
+I originally wrote this simple program as a standalone script and published it
+as a [gist](https://gist.github.com/techouse/4deb94eee58a02d104c6) as an answer
+to this [Stack Overflow question](https://stackoverflow.com/questions/18671/quick-easy-way-to-migrate-sqlite3-to-mysql/32243979#32243979).
+Since then quite some people have taken interest in it since it's so simple and
+effective. Therefore I finally moved my lazy bones and made a GitHub repository :octopus:.
+
+### How to run
+
+```bash
+pip install sqlite3-to-mysql
+sqlite3mysql --help
+```
+
+### Usage
+```
+Usage: sqlite3mysql [OPTIONS]
+
+ Transfer SQLite to MySQL using the provided CLI 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.
+ -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.
+ -S, --skip-ssl Disable MySQL connection encryption.
+ -i, --mysql-insert-method [UPDATE|IGNORE|DEFAULT]
+ 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 [MEDIUMTEXT|TEXT|TINYTEXT|LONGTEXT]
+ 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
+ -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.
+```
+
+
+%prep
+%autosetup -n sqlite3-to-mysql-1.4.16
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-sqlite3-to-mysql -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.4.16-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..d02ae94
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+20193960709546aac1f69d2be8c1088a sqlite3-to-mysql-1.4.16.tar.gz