Macro pgx::pg_binary_magic
source · [−]macro_rules! pg_binary_magic {
($($prelude:ident)::*) => { ... };
}
Expand description
Create the default SQL generator code.
Accepts a single argument, which should be the crate name.
ⓘ
// src/bin/sql-generator.rs
pg_binary_magic!(crate_name);
This creates a binary that:
- Has
tracing
andcolor_eyre
set up. - Supports
EnvFilter
log level configuration. - Accepts
--sql path
and--dot path
args, as well as a list of symbols. These symbols are the__pgx_internals
prefixed ones whichcargo pgx schema
detects.
Using different SQL generator code should be considered an advanced use case, and not recommended.
Note:
cargo pgx schema
or similar commands will automatically scaffold yoursrc/bin/sql-generator.rs
with this if it’s not already present.