biner88 / mysql_utils

Flutter mysql_client plugin helper, Use mysql_client easily.
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

Proposal for simplification #11

Closed harald-schafer closed 1 year ago

harald-schafer commented 2 years 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 ); }

biner88 commented 2 years ago

PR welcome.

biner88 commented 1 year ago

insert , return lastInsertID. insertAll , return affectedRows.