dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.09k stars 68 forks source link

Does not work with CSV vtable. #90

Open pydemo opened 4 years ago

pydemo commented 4 years ago

./litecli mycool.db

Version: 1.3.2

.load /home/ubuntu/src/sqlite-csv-vtable/csv
CREATE VIRTUAL TABLE temp.t1 USING csv(filename="sample.csv");' 'SELECT * FROM t1;

Segmentation fault

amjith commented 4 years ago

I am guessing sqlite-csv-vtable is an sqlite extension that you're loading before trying the create table.

Did this work in the default sqlite3 cli?

The segmentation fault seems to point to the fact that underlying sqlite crashed when the csv() function was executed.

pydemo commented 4 years ago

I am guessing sqlite-csv-vtable is an sqlite extension that you're loading before trying the create table.

Did this work in the default sqlite3 cli?

The segmentation fault seems to point to the fact that underlying sqlite crashed when the csv() function was executed.

Yes, it's working in cli and only in cli. In Python 3/sqlite3 we have to execute con = sqlite3.connect("my.db") con.enable_load_extension(True) con.load_extension("/home/ubuntu/src/sqlite-csv-vtable/csv")

Python2:

from pysqlite2 import dbapi2 as sqlite3 con = sqlite3.connect("my.db") con.enable_load_extension(True) con.load_extension("/home/ubuntu/src/sqlite-csv-vtable/csv")