| std::int64_t sqt::DataContext< ENTITY >::AutoIncInsert | ( | const ENTITY & | entity | ) |
Inserts the specified entity into the database table, automatically generating the primary key value.
| entity | The entity to be inserted. |
| sqt::SQLError | Thrown if the insertion fails. |
This method is similar to the Insert() method, expect that the primary key value in the entity is ignored and automatically generated.
To avoid unique constraint violations due to unique indexes, use the AutoIncReplace() method to replace the existing row instead.
For more control over the conflict action, use the more flexible MakeAutoIncInserter() method from the complex style interface.