Search code examples
databasesqlitefluttersqflite

Return value of db.insert in sqflite?


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.


Solution

  • 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.