1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// use {crate::{Error, Row, ConnectionKind, RefInto}, std::fmt}; use crate::{Error, Row}; pub trait Table { // fn schema(conn: impl RefInto<ConnectionKind>, buff: &mut impl fmt::Write) -> fmt::Result { // match conn.ref_into() { // ConnectionKind::PostgreSQL => Self::postgres_schema(buff), // ConnectionKind::SQLite => Self::sqlite_schema(buff), // } // } // // fn postgres_schema(buff: &mut impl fmt::Write) -> fmt::Result; // // fn sqlite_schema(buff: &mut impl fmt::Write) -> fmt::Result; fn columns() -> usize; fn from_row(row: Row<'_>) -> Result<Self, Error> where Self: Sized; }