Closed harald-schafer closed 1 year ago
Hi this is not a bug or issue but only a proposal. I wonder why the method insert does not internally call insertAll (similar to getOne calling getAll). If you think you can simplify your code a little bit then build method insert similar like this.
Future<int> insert({ required String table, required Map<String, dynamic> insertData, replace = false, debug = false, }) async {
return insertAll( table: table, insertData: [insertData], replace: replace, debug: debug ); }
return insertAll( table: table, insertData: [insertData], replace: replace, debug: debug );
}
PR welcome.
insert , return lastInsertID. insertAll , return affectedRows.
Hi this is not a bug or issue but only a proposal. I wonder why the method insert does not internally call insertAll (similar to getOne calling getAll). If you think you can simplify your code a little bit then build method insert similar like this.
Future<int> insert({ required String table, required Map<String, dynamic> insertData, replace = false, debug = false, }) async {
return insertAll( table: table, insertData: [insertData], replace: replace, debug: debug );
}