The select operation will read and return data from the database. What follows is its implementation:
val NOTE = object : Crud<Note> { ... override fun select( args: Pair<String, String> ): List<Note> = select(listOf(args)) override fun select(args: Collection<Pair<String, String>>): List<Note> { val db = DbHelper(name, version).writableDatabase val selection = StringBuilder() val selectionArgs = mutableListOf<String>() args.forEach { arg -> selection.append("${arg.first} == ?") selectionArgs.add(arg.second) } val result = mutableListOf<Note>() val cursor = db.query( true, DbHelper.TABLE_NOTES, null, selection.toString(), selectionArgs.toTypedArray(), null, null, null, null ) while (cursor.moveToNext()) { val id = cursor.getLong(cursor.getColumnIndexOrThrow ...