Closed adipasquale closed 4 years ago
Thanks for the detailed bug report! This is definitely a compatibility problem with sqlite-utils
2.0, looking into it now.
OK, I think I have a fix for this in https://github.com/simonw/db-to-sqlite/pull/21
@adipasquale would you mind testing this for me? You can install the fix directly from the branch like this:
pip install https://github.com/simonw/db-to-sqlite/archive/sqlite-utils-2.zip
I just tested it against your example from above and it works (whereas older versions fail).
Fixed in https://github.com/simonw/db-to-sqlite/commit/80c064feec51853dadeaffb7205a5dfd4aa32ad4 - I will release this shortly as db-to-sqlite
1.1.
hi @simonw thanks for the incredibly fast answer and fix :o
I tried to test it with your git branch but I think it still installed and used the master version when pip installs the db-to-sqlite package and its dependencies .. my pip skills are quite restricted, sorry.
If it works for you with the example I gave it should be ok! Thanks 🙇
This is now available to install from PyPI directly: pip install db-to-sqlite~=1.1.1
Hi @simonw and thanks for such great tools! I'm using datasette on http://data.greenferries.org/ , it's been a delight.
I think there is an incompatibility with the breaking changes you made on
upsert_all
in version 2+ of sqlite-utils.I get this error when trying to convert a PostgresQL db:
I've managed to mitigate this problem by adding
sqlite-utils==1.12.1
to myrequirements.txt
beforedb-to-sqlite[postgresql]
, and now it works as expected.I tried to understand the actual problem with v2 but I'm not familiar enough with your codebase sorry :/ let me know if I can help somehow.
After digging, it seems to be linked to a specific table in my PostgreSQL db, namely the rails Schema migrations one that contains a single varchar column with 21 entries in my case (surprising). I've bissected it to
db-to-sqlite --table schema_migrations "postgresql://localhost/greenferries_prod_tmp" greenferries.db
triggering the error, I can skip it and it fixes the problem (with sqlite-utils v2+ that is).I've uploaded a small SQL dump on gist so you can reproduce:
(btw I don't actually need this table in datasette, so I've only created this issue for reference).