techouse / mysql-to-sqlite3

Transfer data from MySQL to SQLite
https://techouse.github.io/mysql-to-sqlite3/
MIT License
222 stars 31 forks source link

get table list error when click package is 8.0+ #15

Closed luyinhua closed 3 years ago

luyinhua commented 3 years ago

Describe the bug get table list error when click package is 8.0+

Expected behaviour when i run mysql-to-sqlite3 , but table list is some wrong .

Actual result install the package click when 7.1.2

System Information

$ mysql2sqlite --version
luyinhua commented 3 years ago

python 3.6.9 click 8.0.1 mysql2sqlite 1.4.4

no work

techouse commented 3 years ago

Could you please use the bug report template and supply the full output of mysql2sqlite --version?

luyinhua commented 3 years ago
software version
mysql-to-sqlite3 1.4.4
Operating System Darwin 19.6.0
Python CPython 3.6.9
MySQL mysql Ver 8.0.26 for macos10.15 on x86_64 (Homebrew)
SQLite 3.28.0
click 8.0.1
mysql-connector-python 8.0.25
python-slugify 5.0.2
pytimeparse 1.1.8
simplejson 3.17.2
six 1.15.0
tabulate 0.8.9
tqdm 4.61.1
techouse commented 3 years ago

This test passed so I'm not sure what kind of problem you have.

Can you supply a bit more info that just

no work

luyinhua commented 3 years ago

run log is this

 mysql2sqlite  -f  q_ce9f4a0e1b229aea55826eb4fa01d8eb.sqlite -h 17xxx -P 3306 -u xxx --mysql-password xxxxx -d xxx -C NOCASE -t group digroup_icd digrouperation cd10 md0_zl mdd9 
2021-08-07 21:03:36 INFO     Done!
techouse commented 3 years ago

Seems to me you're using the CLI options incorrectly.

Check the readme again.

luyinhua commented 3 years ago

Seems to me you're using the CLI options incorrectly.

Check the readme again.

but when i install the click==7.1.2 , it work all ok. i don't change other's

techouse commented 3 years ago

Hmm. 🧐 Interesting. Does it work without the -t option?

luyinhua commented 3 years ago

Hmm. 🧐 Interesting. Does it work without the -t option?

yes, without the -t option, it work .

techouse commented 3 years ago

Ok, now I at least know where the issue is. I'll rectify it, but meanwhile, I'll limit Click to 7.x

techouse commented 3 years ago

Hotfixed in v1.4.6

techouse commented 3 years ago

I've done some digging and identified that

with Click v7.x I get the parameters as a tuple

pip freeze | grep -i click
click==7.1.2
mysql2sqlite -f out.db -d test_db -u root -p -t content_files content_media content_usages iframes
<class 'tuple'>
('content_files', 'content_media', 'content_usages', 'iframes')

but with Click v8.x I get a string

pip freeze | grep -i click
click==8.0.1
mysql2sqlite -f out.db -d test_db -u root -p -t content_files content_media content_usages iframes
<class 'str'>
('content_files', 'content_media', 'content_usages', 'iframes')

Seems to be related to https://github.com/pallets/click/issues/2012

techouse commented 3 years ago

Fixed properly in v1.4.7