Skip to content

Commit a3bffcb

Browse files
committed
Implement PgNode for Value and ValUnion types
Postgres 13 and 14 use the `Value` struct to represent multiple possible value types, including integer, float, and string. Each type has its own `NodeTag`, but they can't be automatically associated with the struct using the information in the bindgen bindings. This hard-codes the associations just before emitting all the `PgNode` implementations. Postgres 15 introduced separate structs for each value type. These fit nicely into the automatic struct-to-tag scheme, but we weren't handling the `ValUnion` union Postgres uses to represent these multiple types in a single `Node`. This extends the detection of parent-child types to implement `PgNode` for union nodes.
1 parent 8b2bee7 commit a3bffcb

2 files changed

Lines changed: 237 additions & 147 deletions

File tree

0 commit comments

Comments
 (0)