use std::collections::HashMap;
use crate::{catalog::objects::TableEntry, common::symbol::Symbol};
#[derive(Clone)]
pub struct SchemaEntry {
pub oid: u32,
pub name: Symbol,
pub owner: Symbol,
pub database: Symbol,
pub tables: HashMap<Symbol, TableEntry>,
}
impl SchemaEntry {
pub fn new(oid: u32, name: Symbol, owner: Symbol, database: Symbol) -> Self {
Self {
oid,
name,
owner,
database,
tables: HashMap::new(),
}
}
}
impl std::fmt::Debug for SchemaEntry {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("SchemaEntry")
.field("oid", &self.oid)
.field("name", &self.name)
.field("owner", &self.owner)
.field("database", &self.database)
.field("tables", &self.tables)
.finish()
}
}