Crates.io | libpq-sys |
lib.rs | libpq-sys |
version | 0.8.0 |
source | src |
created_at | 2021-03-27 08:34:09.016058 |
updated_at | 2023-03-12 12:57:29.67755 |
description | Auto-generated rust bindings for libpq |
homepage | |
repository | https://github.com/sanpii/libpq.rs |
max_upload_size | |
id | 374136 |
size | 25,171 |
Autogenerated Rust bindings for libpq
This repository contains direct, one-to-one mappings to the C functions provided
in libpq-fe.h
and 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:
PQ_LIB_DIR
is set, it will use its valuePKG_CONFIG_ALLOW_CROSS
, PKG_CONFIG_ALL_STATIC
etc., of the crate pkg-config
apply.vcpkg integrate install
) and run
vcpkg install libpq:x64-windows
.pg_config --libdir
The build script instructs Cargo to link the library statically if the environmental
variable 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.
dyld: Symbol not found __cg_jpeg_resync_to_restart
on macOSThis is caused when the output of pg_config --libdir
is a directory that also
contains 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
provided 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
manually via cargo build
and then run /target/debug/yourapp
. You can also
manually create a directory that contains only a symlink to libpq.dylib
and
nothing else, then export PQ_LIB_DIR
to that directory. It is recommended that
you do not use postgresapp.com.
Licensed under either of
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.