0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00
sqlpp11/docs/Insert.md
Farook Al-Sammarraie 993ddcc049
Created docs directory (#364)
Copied wiki into docs directory
This allows developers to open pull requests to edit documentation and also use mkdocs to create a styled HTML version

* changed wiki links to relative links

* removed Planned-Features.md

* removed reference to planned features in Home.md
2021-05-09 09:01:22 +02:00

18 lines
725 B
Markdown

Haven't found the time to document this in any detail, yet, but this is an example:
```C++
db(insert_into(tab).set(tab.gamma = true));
```
This is how you could insert multiple rows at a time:
```C++
auto multi_insert = insert_into(t).columns(t.gamma, t.beta, t.delta);
multi_insert.values.add(t.gamma = true, t.beta = "cheesecake", t.delta = 1);
multi_insert.values.add(t.gamma = sqlpp::default_value, t.beta = sqlpp::default_value,
t.delta = sqlpp::default_value);
multi_insert.values.add(t.gamma = sqlpp::value_or_null(true),
t.beta = sqlpp::value_or_null("pie"),
t.delta = sqlpp::value_or_null<sqlpp::integer>(sqlpp::null));
db(multi_insert);
```