Component evidence
Derive ToSql macro for struct and enum serialization to Postgres.
// Source: https://github.com/rust-postgres/rust-postgres | License: Apache-2.0 | Copyright 2016 Steven Fackler
// Provided via justclaw.it.com; keep this notice with the code.
use proc_macro2::{Span, TokenStream};
use quote::quote;
use std::iter;
use syn::{
Data, DataStruct, DeriveInput, Error, Fields, Ident, TraitBound, TraitBoundModifiers,
TypeParamBound,
};
use crate::accepts;
use crate::composites::Field;
use crate::composites::{append_generic_bound, new_derive_path};
use crate::enums::Variant;
use crate::overrides::Overrides;
pub fn expand_derive_tosql(input: DeriveInput) -> Result<TokenStream, Error> {
let overrides = Overrides::extract(&input.attrs, true)?;
if (overrides.name.is_some() || overrides.rename_all.is_some()) && overrides.transparent {
return E
... (truncated -- full source via MCP)