use super::id::{DbObjectId, DependsOn};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ViewColumn {
pub name: String,
pub type_: Option<String>, pub comment: Option<String>,
}
#[derive(Debug, Clone)]
pub struct View {
pub schema: String,
pub name: String,
pub definition: String, pub columns: Vec<ViewColumn>,
pub comment: Option<String>, pub security_invoker: bool, pub security_barrier: bool, pub depends_on: Vec<DbObjectId>, }
impl View {
pub fn id(&self) -> DbObjectId {
DbObjectId::View {
schema: self.schema.clone(),
name: self.name.clone(),
}
}
}
impl DependsOn for View {
fn id(&self) -> DbObjectId {
DbObjectId::View {
schema: self.schema.clone(),
name: self.name.clone(),
}
}
fn depends_on(&self) -> &[DbObjectId] {
&self.depends_on
}
}