https://kotlinlang.org logo
Title
u

user

07/12/2022, 10:11 AM
SQLite INSERT, changes() sometimes return 1, even if row already existed I've got dedup table: CREATE TABLE UniqueFile (filePath TEXT NOT NULL UNIQUE, created INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))) which along with SQLite changes() function I use to determine if file entry is inserted for the first time or not. Below function is supposed to indicate if the entry is processed for the first time: fun insertFilePath(filePath : String) : Boolean { val db = this.writableDatabase db.execSQL("INSERT OR IGNORE INTO UniqueFile (filePath)...