mattn/go-sqlite3

How to run a dot command like ".import file.csv test"?

evt opened this issue · 2 comments

evt commented
_, err = db.Exec(".import epf.csv video")
if err != nil {
    log.Fatal(err)
}

Error: near ".": syntax error

In my experience, those commands are not supported by this library. .schema will result in the same thing.

mattn commented

it's a feature of sqlite3 command not this library. if you want, you need to implement the feature or call sqlite3 command.

exec.Command("sqlite3", "-cmd", ".import sample.csv ").CaptureOutput()