Skip to content

Importing CSV to sqlite3 fails due to invalid command-line syntax #482

@giladarnold

Description

@giladarnold

When importing a CSV odo invokes sqlite3 with command-line arguments: sqlite3 -nullvalue '' -separator , -cmd '.import "/path/to/csv/file" tablename' /path/to/db/file

However, current sqlite3 (version 3.6.20) does not support a -cmd option. Instead, the invocation should look like this: sqlite3 -nullvalue '' -separator , /path/to/db/file '.import "/path/to/csv/file" tablename'

I patched odo/backends/sql_csv.py:compile_from_csv_sqlite() accordingly and it works like a charm. Happy to submit the patch if that'll speed things up. Please advise, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions