| 1 | use crate::ext::ustr::UStr; |
| 2 | use crate::protocol::text::ColumnFlags; |
| 3 | use crate::{MySql, MySqlTypeInfo}; |
| 4 | pub(crate) use sqlx_core::column::*; |
| 5 | |
| 6 | #[derive(Debug, Clone)] |
| 7 | #[cfg_attr(feature = "offline", derive(serde::Serialize, serde::Deserialize))] |
| 8 | pub struct MySqlColumn { |
| 9 | pub(crate) ordinal: usize, |
| 10 | pub(crate) name: UStr, |
| 11 | pub(crate) type_info: MySqlTypeInfo, |
| 12 | |
| 13 | #[cfg_attr(feature = "offline", serde(skip))] |
| 14 | pub(crate) flags: Option<ColumnFlags>, |
| 15 | } |
| 16 | |
| 17 | impl Column for MySqlColumn { |
| 18 | type Database = MySql; |
| 19 | |
| 20 | fn ordinal(&self) -> usize { |
| 21 | self.ordinal |
| 22 | } |
| 23 | |
| 24 | fn name(&self) -> &str { |
| 25 | &self.name |
| 26 | } |
| 27 | |
| 28 | fn type_info(&self) -> &MySqlTypeInfo { |
| 29 | &self.type_info |
| 30 | } |
| 31 | } |