Closed lei0zhou closed 1 month ago
So the sqlite cli is compiled with that support. Bog standard embedded sqlite does not have this ability. https://sqlite.org/cli.html
Your best bet is to parse the CSV and stream it into the database
"priv/english.csv"
|> File.stream!()
|> CSV.decode()
|> Enum.each(fn row ->
Repo.insert(....)
end)
Or use the CLI to import it manually.
EDIT:
Sqlean has an ability to read a CSV as a virtual table as well https://github.com/nalgeon/sqlean but you'll need to compile the extension and load it.
for example importing a csv file, could you suggest a way to do that? thanks!