Closed liorzam closed 7 years ago
not sure if such a method exists. Can you point me to the SQLite documentation for this method?
you right this method doesnt support in sqlite. but DBFlow is ORM for sql and methods like increase/decrease for int property will be useful.
private void increaseIntColumn(final DatabaseWrapper databaseWrapper, final String whereClause, Property<Integer> column) {
final String columnName = column.toString();
final String sqlCommand = String.format("UPDATE %s SET %s = %s + 1 WHERE %s", User.TABLE_NAME, columnName, columnName, whereClause);
databaseWrapper.execSQL(sqlCommand);
}
you can use the concatenate(1)
method on a Property
. Also that query you want to use should be used this way:
SQLite.update(User.class)
.set(User_Table.someColumn.concatenate(1))
.where(...)
.executeUpdateDelete();
DBFlow Version:4.0.0-beta2 Issue Kind : Feature Description: Adding new SQLCondition for increase/decrease INTEGER column
like: SQLite.update(User.class).set(User_Table.friendsCount.increase())