MCPcopy Create free account
hub / github.com/belchior/sql_query_builder / alter

Method alter

src/alter_table/alter_table.rs:418–422  ·  view source on GitHub ↗

Alter columns or table constraints. Multiples call of this method will build the SQL respecting the order of the calls ### Example ``` # #[cfg(any(feature = "postgresql", feature = "mysql"))] # { # use sql_query_builder as sql; let query = sql::AlterTable::new() .alter("COLUMN created_at SET DEFAULT now()") .to_string(); # let expected = "ALTER COLUMN created_at SET DEFAULT now()"; # assert_eq!

(mut self, alter_exp: &str)

Source from the content-addressed store, hash-verified

416 /// ALTER COLUMN created_at SET DEFAULT now()
417 /// ```
418 pub fn alter(mut self, alter_exp: &str) -> Self {
419 let action = AlterTableActionItem(AlterTableOrderedAction::Alter, alter_exp.trim().to_string());
420 push_unique(&mut self._ordered_actions, action);
421 self
422 }
423}
424
425impl std::fmt::Display for AlterTable {

Calls 2

push_uniqueFunction · 0.85