-2

Insert function on database in sqflite returns id of row inserted. But I want to know what it returns if an error occurs after getting an error during insertion. Thanks in advance.

2 Answers2

0

It should throw an error and then you can let it return whatever you want.

JayJay
  • 141
  • 8
0

I have used sqflite package which is used by flutter to work with sqlite3. When we insert a row in table using insert method, it returns row id if successfully inserted or an error if there was some problem.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – xTrimy Nov 16 '21 at 16:14
  • Check now again if it is clear. – vedant kulkarni May 22 '22 at 06:50