rawInsert method

Future<int?> rawInsert(
  1. String pSql,
  2. List? params,
  3. bool ignoreBatch
)

Implementation

Future<int?> rawInsert(
    String pSql, List<dynamic>? params, bool ignoreBatch) async {
  int result = 0;
  try {
    if (openedBatch[_dbModel!.databaseName!] == null || ignoreBatch) {
      final Database db = (await this.db)!;
      result = await db.rawInsert(pSql, params);
    } else {
      openedBatch[_dbModel!.databaseName!]!.rawInsert(pSql, params);
      result = 1; // Batch rawInsert do not returns any value (void)
    }
  } catch (e) {
    print(e.toString());
    rethrow;
  }
  return result;
}