|0.4.6||Jul 15, 2018|
|0.4.4||Jul 4, 2017|
|0.4.3||Mar 10, 2017|
|0.2.7||Dec 10, 2016|
|0.2.0||Nov 21, 2015|
#59 in Encoding
6,724 downloads per month
Used in 57 crates (1 directly)
Autogenerated Rust bindings for libpq
This repository contains direct, one-to-one mappings to the C functions provided
postgres_ext.h. This library expects that libpq be
installed on the system.
The build script of crate will attempt to find the lib path of libpq using the following methods:
- First, if the environment variable
PQ_LIB_DIRis set, it will use its value
- If the environment variable isn't set, it tries to use pkg-config to locate it.
All the config options, such as
PKG_CONFIG_ALL_STATICetc., of the crate pkg-config apply.
- For MSVC ABI builds the build script will attempt use the library from a
vcpkg installation if there is one available.
You may need to set VCPKG_ROOT (or run
vcpkg integrate install) and run
vcpkg install libpq:x64-windows.
- If it still can't locate the library, it will invoke the Postgres command
The build script instructs Cargo to link the library statically if the environmental
PQ_LIB_STATIC is set. This can be useful, if targeting for a musl target.
If pkg-config is being used, it's configuration options will apply.
This is caused when the output of
pg_config --libdir is a directory that also
libjpeg.dylib which differs from the system libjpeg. This is usually
caused by install postgres via homebrew, or using postgresapp.com.
If you've installed via homebrew, you should not see this issue unless you've
features = ["pkg-config"]. You can work around the issue by exporting
PQ_LIB_DIR="$(brew --prefix postgres)/lib".
If you've installed postgresql using postgresapp.com, you will not be able to
run your binaries using
cargo run or
cargo test. You can compile the binary
cargo build and then run
/target/debug/yourapp. You can also
manually create a directory that contains only a symlink to
nothing else, then export
PQ_LIB_DIR to that directory. It is recommended that
you do not use postgresapp.com.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.