DataBrewery / cubes

[NOT MAINTAINED] Light-weight Python OLAP framework for multi-dimensional data analysis
http://cubes.databrewery.org
Other
1.49k stars 313 forks source link

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked #493

Open EmmaGuo910 opened 3 years ago

EmmaGuo910 commented 3 years ago

I found create_table_from_csv is too slow. I tried to use multiprocessing, but there is a lock of database, how should I do

thanks

pdsparks commented 3 years ago

Hi - I believe that sqlite write-locking will prevent multi process inserts.

If you are trying to generate a table for one-off data exploration I would use a free program like HeidiSQL (Tools - Import CSV)

If you are looking to automate an import process then maybe try checking this Stack response [here] (https://stackoverflow.com/questions/6977497/import-csv-file-into-sqlite3-database-in-command-line-or-via-batch-file)