Data Manipulation


table has an insert() method, which takes one value, of the table's value type, as its argument, and adds that value to the table. It's a wrapper for SQL's INSERT.

points.insert({1.4f, -5.6f});

table::insert() returns void.

serial_table also has an insert() method, which differs as follows:

  • It doesn't use the whole value it is passed: it ignores the primary key member.
  • It lets the DBMS assign a primary key to the newly inserted record.
  • Its return type is serial, and it returns the DBMS-assigned key.
  • It has an overload that takes the record by non-const reference. That overload copies the DBMS-assigned key into the given record's primary key member, as well as returning it.