macro_rules! sqlx_implementations_for_wrapper {
($WRAPPED:ty, $DBTYPE:expr, $NAME:ty, $DOMAIN:ty) => { ... };
}
Expand description
Macro to handle numeric types that are non-negative but are stored by Db-Sync using signed SQL types.
This macro generates an unsigned numeric domain type and sqlx trait implementation for decoding it from signed data coming from Db-Sync database. It expects that values will always have 0 as the most significant bit.
For example because TxIndex is in range of [0, 2^15-1], it will be u16 in domain, but it requires encoding and decoding as i16.
See txindex
, word31
and
word63 types in Db-Sync schema definition.