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

Method drop

src/alter_table/alter_table.rs:187–191  ·  view source on GitHub ↗

Drops columns or table constraints, this method overrides the previous value. ### Example ``` # use sql_query_builder as sql; let query = sql::AlterTable::new() .drop("column login") .as_string(); # let expected = "DROP column login"; # assert_eq!(expected, query); ``` Outputs ```sql DROP column login ``` ### Available on crate feature `postgresql` and `mysql` only. Multiples call of this me

(mut self, drop_exp: &str)

Source from the content-addressed store, hash-verified

185 /// DROP column login, DROP constraint login_unique
186 /// ```
187 pub fn drop(mut self, drop_exp: &str) -> Self {
188 let action = AlterTableActionItem(AlterTableOrderedAction::Drop, drop_exp.trim().to_string());
189 push_unique(&mut self._ordered_actions, action);
190 self
191 }
192
193 /// Creates instance of the [AlterTable] command
194 pub fn new() -> Self {

Calls 2

push_uniqueFunction · 0.85