clementine_core::database::wrapper

Macro impl_bytea_wrapper_default

Source
macro_rules! impl_bytea_wrapper_default {
    ($wrapper:ident, $inner:ty) => { ... };
}
Expand description

Macro for implementing BYTEA-based SQL wrapper types using standard serialization

This macro creates a wrapper type that uses the inner type’s default serialization methods (serialize() and from_slice()) for encoding/decoding to/from BYTEA columns.

§Parameters

  • $wrapper: The name of the wrapper type to create
  • $inner: The inner type being wrapped

The macro creates a new type that wraps the inner type and implements:

  • SQLx Type trait to indicate BYTEA column type
  • SQLx Encode trait for converting to database format
  • SQLx Decode trait for converting from database format