1919 help = "SQLite3 database file" ,
2020 required = True ,
2121)
22- @click .option (
23- "-d" , "--mysql-database" , default = None , help = "MySQL database name" , required = True
24- )
22+ @click .option ("-d" , "--mysql-database" , default = None , help = "MySQL database name" , required = True )
2523@click .option ("-u" , "--mysql-user" , default = None , help = "MySQL user" , required = True )
2624@click .option (
2725 "-p" ,
8078 help = "Prefix indices with their corresponding tables. "
8179 "This ensures that their names remain unique across the SQLite database." ,
8280)
83- @click .option (
84- "-X" , "--without-foreign-keys" , is_flag = True , help = "Do not transfer foreign keys."
85- )
81+ @click .option ("-X" , "--without-foreign-keys" , is_flag = True , help = "Do not transfer foreign keys." )
8682@click .option (
8783 "-W" ,
8884 "--without-data" ,
8985 is_flag = True ,
9086 help = "Do not transfer table data, DDL only." ,
9187)
92- @click .option (
93- "-h" , "--mysql-host" , default = "localhost" , help = "MySQL host. Defaults to localhost."
94- )
95- @click .option (
96- "-P" , "--mysql-port" , type = int , default = 3306 , help = "MySQL port. Defaults to 3306."
97- )
98- @click .option (
99- "-S" , "--skip-ssl" , is_flag = True , help = "Disable MySQL connection encryption."
100- )
88+ @click .option ("-h" , "--mysql-host" , default = "localhost" , help = "MySQL host. Defaults to localhost." )
89+ @click .option ("-P" , "--mysql-port" , type = int , default = 3306 , help = "MySQL port. Defaults to 3306." )
90+ @click .option ("-S" , "--skip-ssl" , is_flag = True , help = "Disable MySQL connection encryption." )
10191@click .option (
10292 "-c" ,
10393 "--chunk" ,
123113)
124114@click .option ("-q" , "--quiet" , is_flag = True , help = "Quiet. Display only errors." )
125115@click .option ("--debug" , is_flag = True , help = "Debug mode. Will throw exceptions." )
126- @click .version_option (
127- message = tabulate (info (), headers = ["software" , "version" ], tablefmt = "github" )
128- )
116+ @click .version_option (message = tabulate (info (), headers = ["software" , "version" ], tablefmt = "github" ))
129117def cli (
130118 sqlite_file ,
131119 mysql_user ,
@@ -153,9 +141,7 @@ def cli(
153141 """Transfer MySQL to SQLite using the provided CLI options."""
154142 try :
155143 if mysql_tables and exclude_mysql_tables :
156- raise click .UsageError (
157- "Illegal usage: --mysql-tables and --exclude-mysql-tables are mutually exclusive!"
158- )
144+ raise click .UsageError ("Illegal usage: --mysql-tables and --exclude-mysql-tables are mutually exclusive!" )
159145
160146 converter = MySQLtoSQLite (
161147 sqlite_file = sqlite_file ,
@@ -167,8 +153,7 @@ def cli(
167153 limit_rows = limit_rows ,
168154 collation = collation ,
169155 prefix_indices = prefix_indices ,
170- without_foreign_keys = without_foreign_keys
171- or (mysql_tables is not None and len (mysql_tables ) > 0 ),
156+ without_foreign_keys = without_foreign_keys or (mysql_tables is not None and len (mysql_tables ) > 0 ),
172157 without_data = without_data ,
173158 mysql_host = mysql_host ,
174159 mysql_port = mysql_port ,
0 commit comments