Update documentation for making diesel work

This commit is contained in:
Eric Kidd 2018-04-25 07:00:34 -04:00
parent 55b72cbe89
commit bc32059eee
2 changed files with 8 additions and 11 deletions

View file

@ -30,10 +30,7 @@ With a bit of luck, you should be able to just copy your application binary from
- OpenSSL, which is needed by many Rust applications. - OpenSSL, which is needed by many Rust applications.
- `libpq`, which is needed for applications that use `diesel` with PostgreSQL. Note that this may be broken under Rust 1.21.0 and later (see https://github.com/emk/rust-musl-builder/issues/27). - `libpq`, which is needed for applications that use `diesel` with PostgreSQL. Note that this may be broken under Rust 1.21.0 and later (see https://github.com/emk/rust-musl-builder/issues/27).
- `libz`, which is needed by `libpq`. - `libz`, which is needed by `libpq`.
- SQLite3. See [examples/using-diesel](./examples/using-diesel/).
You can also use the following libraries with a bit of setup:
- SQLite3 with `diesel`. See [examples/using-diesel](./examples/using-diesel/).
This library also sets up the environment variables needed to compile popular Rust crates using these libraries. This library also sets up the environment variables needed to compile popular Rust crates using these libraries.
@ -63,13 +60,13 @@ In addition to setting up OpenSSL, you'll need to add the following lines to you
```toml ```toml
[dependencies] [dependencies]
# This is needed to make sure that Cargo statically links against diesel = { version = "1", features = ["postgres", "sqlite"] }
# `libssl`. This should happen automatically, but it doesn't.
openssl-sys = "0.9"
[patch.crates-io] # Needed for sqlite.
# This is needed to handle cross-compilation of libpq. libsqlite3-sys = { version = "*", features = ["bundled"] }
pq-sys = { git = 'https://github.com/golddranks/pq-sys' }
# Needed for Postgres.
openssl = "*"
``` ```
See [this PR](https://github.com/sgrif/pq-sys/pull/18) for a discussion of the issues involved in cross-compiling `diesel` and `diesel_codegen`. See [this PR](https://github.com/sgrif/pq-sys/pull/18) for a discussion of the issues involved in cross-compiling `diesel` and `diesel_codegen`.

View file

@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Eric Kidd <git@randomhacks.net>"] authors = ["Eric Kidd <git@randomhacks.net>"]
[dependencies] [dependencies]
diesel = { version = "*", features = ["postgres", "sqlite"] } diesel = { version = "1", features = ["postgres", "sqlite"] }
# Needed for sqlite. # Needed for sqlite.
libsqlite3-sys = { version = "*", features = ["bundled"] } libsqlite3-sys = { version = "*", features = ["bundled"] }
# Needed for Postgres. # Needed for Postgres.