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

Method add

src/alter_table/alter_table.rs:57–61  ·  view source on GitHub ↗

Adds columns or table constraints, this method overrides the previous value ### Example ``` # use sql_query_builder as sql; let query = sql::AlterTable::new() .add("COLUMN age int not null") .as_string(); # let expected = "ADD COLUMN age int not null"; # assert_eq!(expected, query); ``` Outputs ```sql ADD COLUMN age int not null ``` ### Available on crate feature `postgresql` and `mysql` onl

(mut self, add_exp: &str)

Source from the content-addressed store, hash-verified

55 /// ADD CONSTRAINT login_unique unique(login)
56 /// ```
57 pub fn add(mut self, add_exp: &str) -> Self {
58 let action = AlterTableActionItem(AlterTableOrderedAction::Add, add_exp.trim().to_string());
59 push_unique(&mut self._ordered_actions, action);
60 self
61 }
62
63 /// Defines the name of the table to be altered, this method overrides the previous value
64 ///

Calls 2

push_uniqueFunction · 0.85