pgmt 0.4.8

PostgreSQL migration tool that keeps your schema files as the source of truth
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Generic comment operations for all object types

use crate::catalog::id::DbObjectId;

/// Generic comment operation that works for any object type
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CommentOperation<T> {
    Set { target: T, comment: String },
    Drop { target: T },
}

/// Trait for objects that can have comments
pub trait CommentTarget {
    const OBJECT_TYPE: &'static str;
    fn identifier(&self) -> String;
    fn db_object_id(&self) -> DbObjectId;
}