Code Monkey home page Code Monkey logo

Comments (3)

JBPressac avatar JBPressac commented on June 10, 2024

Hello,
I have got the same error trying to convert a table from a MySQL database. The table has the following schema:

CREATE TABLE IF NOT EXISTS ville (
id int(11) NOT NULL AUTO_INCREMENT,
nom varchar(100) NOT NULL,
wikidata varchar(20) NOT NULL,
idref varchar(10) NOT NULL,
pays_id int(11),
latitude decimal(13,10),
longitude decimal(13,10),
PRIMARY KEY (id),
KEY ville_10741763 (pays_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=720 ;

However, after running:
pipenv run db-to-sqlite "mysql://user@localhost/database" database.db --table=ville -p

The following error is displayed:

qlite3.InterfaceError: Error binding parameter 1 - probably unsupported type.

and database.db contains (among other things, but without any data):
CREATE TABLE [ville] (
[id] INTEGER PRIMARY KEY,
[nom] TEXT,
[wikidata] TEXT,
[idref] TEXT,
[pays_id] TEXT,
[latitude] TEXT,
[longitude] TEXT
)

I am using Python 3.8.0 and the followings libraries:
aiofiles 0.4.0
Click 7.0
click-default-group 1.2.2
csvs-to-sqlite 1.0
datasette 0.33
datasette-cluster-map 0.8
datasette-vega 0.6.2
dateparser 0.7.2
db-to-sqlite 1.0.2
h11 0.9.0
httptools 0.0.13
hupper 1.9.1
Jinja2 2.10.3
MarkupSafe 1.1.1
mysqlclient 1.4.6
numpy 1.18.1
pandas 0.25.3
Pint 0.10.1
pip 19.3.1
pluggy 0.13.1
py-lru-cache 0.1.4
pylzma 0.5.0
python-dateutil 2.8.1
pytz 2019.3
regex 2020.1.8
setuptools 42.0.1
six 1.14.0
SQLAlchemy 1.3.12
sqlite-utils 2.0.1
tabulate 0.8.6
tzlocal 2.0.0
uvicorn 0.11.2
uvloop 0.14.0
websockets 8.1
wheel 0.33.6

Thanks,

from db-to-sqlite.

simonw avatar simonw commented on June 10, 2024

The unique column types in that first example are:

 char(1) DEFAULT NULL,
 decimal(2,1) DEFAULT NULL,
 decimal(3,1) DEFAULT NULL,
 int(11) DEFAULT NULL,
 mediumint(9) DEFAULT NULL,
 smallint(3) unsigned DEFAULT NULL,
 smallint(6) DEFAULT NULL,
 text,
 tinyint(2) unsigned DEFAULT NULL,
 varchar(10) DEFAULT NULL,
 varchar(12) DEFAULT NULL,
 varchar(16) NOT NULL,
 varchar(2) DEFAULT NULL,
 varchar(50) DEFAULT NULL,%                                                                                                                                                                     

The only one that looks suspicious there is decimal - which is present in the second example too.

from db-to-sqlite.

simonw avatar simonw commented on June 10, 2024

It's possible that this bug has been fixed by either the latest sqlite-utils or the latest SQLAlchemy - I'm going to close this as can't reproduce, please comment here if you run into it again.

from db-to-sqlite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.