Installing Diesel CLI on macOS with SQLite Support Only

I was creating Tauri (opens in a new tab) app and wante to use the Diesel (opens in a new tab) crate for the Rust backend.

Installing Diesel with the default cargo install diesel_cli tries to install everything. And diesel actually expects you to have the binary for the database you'll be using already installed.

It gave me the error:

...lots of clang output...
  = note: ld: library not found for -lmysqlclient
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
...more output...

Which meant it was trying to install the mysqlclient binary which I didn't have or need. Using this invocation of the diesel CLI solved my problem:

cargo install diesel_cli --no-default-features --features sqlite
Updated Last:2023-01-18T16:36:48.000Z