sqlInsert method

Future<int?> sqlInsert({
  1. bool verbose = false,
})

Insert a row in the database table

Implementation

Future<int?> sqlInsert({bool verbose = false}) async {
  _checkDbIsReady();
  final data = this.toDb();
  final row = _toStringsMap(data);
  final id = await db!
      .insert(table: table!.name, row: row, verbose: verbose)
      .catchError((dynamic e) =>
          throw WriteQueryException("Can not insert model into database $e"));
  return id;
}