#[derive(Debug, Clone, PartialEq)] #[allow(dead_code)] pub enum ColumnType { String {}, Integer {}, BitFlag { /// The bit flag values values: indexmap::IndexMap<&'static str, u64>, }, Boolean {}, User {}, Channel {}, Role {}, Emoji {}, Message {}, } #[derive(Debug, Clone, PartialEq)] pub enum OptionType { Single, Multiple, } #[derive(Debug, Clone, PartialEq)] pub enum ColumnSuggestion { Static { suggestions: Vec<&'static str>, }, Dynamic { table_name: &'static str, column_name: &'static str, }, None, } #[derive(Debug, Clone, PartialEq)] pub struct Column { /// The ID of the column pub id: &'static str, /// The friendly name of the column pub name: &'static str, /// The type of the column pub column_type: ColumnType, /// Whether or not the column is nullable pub nullable: bool, /// Suggestions to display pub suggestions: ColumnSuggestion, /// Whether or not the column is unique pub unique: bool, /// Whether or not the column is an array pub array: bool, } #[derive(Debug, Clone, PartialEq)] pub struct OperationSpecific { /// The corresponding command for ACL purposes pub corresponding_command: &'static str, /// Which column ids should be usable for this operation /// /// E.g, create does not need to show created_at or id while view should pub column_ids: Vec<&'static str>, /// Any columns to set. For example, a last_updated column should be set on update /// /// Variables: /// - {user_id} => the user id of the user running the operation /// - {now} => the current timestamp /// /// Note: only applies to create, update and delete /// /// Key should be of form `table_name.column_name` and value should be the value to set pub columns_to_set: indexmap::IndexMap<&'static str, &'static str>, } #[derive(Debug, Clone, PartialEq)] #[allow(dead_code)] pub enum OperationType { View, Create, Update, Delete, } #[derive(Debug, Clone, PartialEq)] pub struct ConfigOption { /// The ID of the option pub id: &'static str, /// The name of the option pub name: &'static str, /// The description of the option pub description: &'static str, /// The table name for the config option pub table: &'static str, /// The column name refering to the guild id of the config option pub guild_id: &'static str, /// The columns for this option pub columns: Vec, /// The type of the option pub option_type: OptionType, /// Operation specific data pub operations: indexmap::IndexMap, }