use std::{any::TypeId, borrow::Cow, num::NonZeroU32}; #[derive(Debug, Clone)] pub enum PostgresDatatype { Bigint, Bigserial, Bit(Option), BitVarying(Option), Boolean, Box, Bytea, Character(Option), CharacterVarying(Option), Cidr, Circle, Date, DoublePrecision, Inet, Integer, Interval(Option,Option), Json, Jsonb, Line, Lseg, Macaddr, Macaddr8, Money, Numeric(Option), Path, PgLsn, PgSnapshot, Point, Polygon, Real, SmallInt, SmallSerial, Serial, Text, Time(Option), TimeTz(Option), Timestamp(Option), TimestampTz(Option), TsQuery, TsVector, TxidSnapshot, Uuid, Xml, } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum IntervalFields { Year, Month, Day, Hour, Minute, Second, YearToMonth, DayToHour, DayToMinute, DayToSecond, HourToMinute, HourToSecond, MinuteToSecond, } #[derive(Debug, Clone, Copy)] pub enum NumericConfig { Precision(u16), PrecisionAndScale(u16, i16), } #[derive(Debug, Clone)] pub struct Table { pub columns: Cow<'static, [Column]>, } #[derive(Debug, Clone)] pub struct Column { pub postgres_name: Cow<'static, str>, pub postgres_datatype: PostgresDatatype, pub field_name: Cow<'static, str>, pub rust_type_id: fn() -> TypeId, }