insert method

Future<InstanceType> insert ()

Inserts an InstanceType into the underlying database.

The Query must have its values or valueMap property set. This operation will insert a row with the data supplied in those fields to the database in context. The return value is a Future that completes with the newly inserted InstanceType. Example:

  var q = Query<User>()
    ..values.name = "Joe";
  var newUser = await q.insert();

If the InstanceType has properties with Validate metadata, those validations will be executed prior to sending the query to the database.

Implementation

Future<InstanceType> insert();