dbui-core 0.0.64

Core classes used by dbui in the app and WASM
use serde::{Deserialize, Serialize};

/// A database view, with column information
#[derive(Clone, derive_more::Constructor, Debug, Serialize, Deserialize)]
pub struct View {
  oid: u32,
  schema: String,
  name: String,
  owner: String,
  columns: Vec<crate::Column>,
  size: i64,
  description: Option<String>
}

impl View {
  pub fn oid(&self) -> u32 {
    self.oid
  }

  pub fn schema(&self) -> &String {
    &self.schema
  }

  pub fn name(&self) -> &String {
    &self.name
  }

  pub fn owner(&self) -> &String {
    &self.owner
  }

  pub fn columns(&self) -> &Vec<crate::Column> {
    &self.columns
  }

  pub fn size(&self) -> i64 {
    self.size
  }

  pub fn description(&self) -> &Option<String> {
    &self.description
  }
}