Skip to main content

Crate postgresql_macros

Crate postgresql_macros 

Source
Expand description

Compile-time checked query macros for the postgresql crate.

query! and query_as! build a query and, when DATABASE_URL is set at build time (and STDX_POSTGRESQL_CHECK is not false), connect to the database, describe the statement and check that the parameters match the server-inferred types. When the SQL is not a string literal, or checking is disabled, the same code compiles and is decoded at runtime.

Macrosยง

copy_in
Builds a compile-time checked binary COPY ... FROM STDIN.
copy_out
Builds a compile-time checked binary COPY ... TO STDOUT.
query
Builds an untyped query. See the crate documentation.
query_as
Builds a query decoded into a named type. See the crate documentation.