elefant-tools 0.0.8

A library for doing things like pg_dump and pg_restore, with extra features, and probably more bugs.
Documentation
use crate::object_id::ObjectId;
use crate::whitespace_ignorant_string::WhitespaceIgnorantString;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;

#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
pub struct PostgresCheckConstraint {
    pub name: String,
    pub check_clause: WhitespaceIgnorantString,
    pub comment: Option<String>,
    pub is_enforced: bool,
    pub object_id: ObjectId,
}

impl Default for PostgresCheckConstraint {
    fn default() -> Self {
        Self {
            name: String::new(),
            check_clause: WhitespaceIgnorantString::default(),
            comment: None,
            is_enforced: true,
            object_id: ObjectId::default(),
        }
    }
}

impl PartialOrd for PostgresCheckConstraint {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}

impl Ord for PostgresCheckConstraint {
    fn cmp(&self, other: &Self) -> Ordering {
        self.name.cmp(&other.name)
    }
}