Diesel: Can't do `diesel setup` with sqlite database?

Created on 16 Mar 2017  ·  3Comments  ·  Source: diesel-rs/diesel

$ diesel --version
diesel 0.11.0
$ sqlite3 --version
3.17.0 2017-02-13 16:02:40 ada05cfa86ad7f5645450ac7a2a21c9aa6e57d2c
$ rg "#define SQLITE_VERSION" /usr/include/sqlite3.h
124:#define SQLITE_VERSION        "3.17.0"
$ rustc --version
rustc 1.17.0-nightly (0aeb9c129 2017-03-15)
$ DATABASE_URL="sqlite:///tmp/database.sql" diesel setup
Creating database: sqlite:///tmp/database.sql
Unable to open the database file

I am having trouble doing anything through the diesel binary with a sqlite database. I feel like it must be something I'm doing wrong, but I haven't been able to figure it out. I've tried with sqlite:///tmp/database.sql and file:///tmp/database.sql with the same result. I've tried first opening the file with the sqlite3 binary and then trying diesel setup, to no avail. Can anyone tell me what I might be doing wrong here? Thanks!

Most helpful comment

Closing this because I just had to remove the "sqlite://" from the URL. Doing DATABASE_URL=/tmp/database.sql diesel setup seems to work fine.

All 3 comments

Closing this because I just had to remove the "sqlite://" from the URL. Doing DATABASE_URL=/tmp/database.sql diesel setup seems to work fine.

This really should be documented somewhere more obvious, such as the main page

@sburris0 Feel free to provide a PR doing this. Otherwise this is already documented as part of the SqliteConnection documentation.

Was this page helpful?
0 / 5 - 0 ratings