The manual-mint arm of the 12-arm transaction UNION, as a view.
Same motivation as depositTransactionView: assembled inline the union
serialises well past the 16KB statement limit RDS Proxy will parse, and a
statement over that limit pins the client session to its database connection
for the rest of the session. Behind a view the runtime statement is ~90
bytes.
The caller-supplied filters live in
transaction-services/queries/manualMint.ts as predicates on this view's own
projected columns, because a view takes no parameters. They are plain
contract-column comparisons emitted by the shared
transactionScalarConditions, so what matters here is what each filtered
column projects:
customer_id — customer.external_id.
signature — manual_mint.receipt. Single sub-arm, so Postgres pushes the
predicate through the view down to idx_manual_mint_receipt.
Changing what those three project silently changes the filters. The column
list must also stay identical to the sibling arms, or the UNION breaks.
securityInvoker is required, not cosmetic — every underlying table has RLS
enabled, and without it the view would run with the owner's row visibility
and silently bypass the querying role's policies.
The manual-mint arm of the 12-arm transaction UNION, as a view.
Same motivation as
depositTransactionView: assembled inline the union serialises well past the 16KB statement limit RDS Proxy will parse, and a statement over that limit pins the client session to its database connection for the rest of the session. Behind a view the runtime statement is ~90 bytes.The caller-supplied filters live in
transaction-services/queries/manualMint.tsas predicates on this view's own projected columns, because a view takes no parameters. They are plain contract-column comparisons emitted by the sharedtransactionScalarConditions, so what matters here is what each filtered column projects:Changing what those three project silently changes the filters. The column list must also stay identical to the sibling arms, or the UNION breaks.
securityInvokeris required, not cosmetic — every underlying table has RLS enabled, and without it the view would run with the owner's row visibility and silently bypass the querying role's policies.