handleInsert method

Future<int?> handleInsert()

Handle insert.

Implementation

Future<int?> handleInsert() async {
  var database = getDatabaseOrThrow();
  if (database.readOnly) {
    throw SqfliteFfiException(
        code: sqliteErrorCode, message: 'Database readonly');
  }

  await handleExecute();

  // null means no insert
  var id = database.getLastInsertId();
  if (logLevel >= sqfliteLogLevelSql) {
    print('$_prefix Inserted id $id');
  }
  return id;
}