You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mysql2sqlite version 2.3.0 Copyright (c) 2019-2024 Klemen Tusar
2024-11-24 18:52:15 INFO Transferring table test
2024-11-24 18:52:16 ERROR SQLite failed creating table test: near "[]": syntax error
Traceback (most recent call last):
File "/root/.local/bin/mysql2sqlite", line 8, in <module>
sys.exit(cli())
^^^^^
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/mysql_to_sqlite3/cli.py", line 230, in cli
converter.transfer()
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/mysql_to_sqlite3/transporter.py", line 700, in transfer
self._create_table(table_name) # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/share/pipx/venvs/mysql-to-sqlite3/lib/python3.12/site-packages/mysql_to_sqlite3/transporter.py", line 568, in _create_table
self._sqlite_cur.executescript(self._build_create_table_sql(table_name))
sqlite3.OperationalError: near "[]": syntax error
Ohh, you're right!
I didn't pay attention to the fact that that mariadb differs from mysql in these regards...
But I can't test it with mysql 'cause I've only mariadb instance. 🤷♂️
Yes, I checked it in Docker with mysql:8. It works, successfully creates sqlite with the schema:
CREATETABLEIF NOT EXISTS "test" (
"test"TEXTNOT NULL DEFAULT '[]'
);
But unfortunately, it won't help me, because my source database is in MariaDB, and I won't be able to convert it to mysql for the same reason (schema is not compatible with mysql).
I'll try to find an alternative solution, or write it myself.
Describe the bug
Table with that definition cause exception:
Expected behaviour
Successful table creation
Actual result
System Information
The text was updated successfully, but these errors were encountered: