DBFlow
DBFlow copied to clipboard
Typo in OrderBy Clause: "DSC" Should Be "DESC" in SQLite
In DBFlow / library / src / main / java / com / grosner / dbflow / sql / language / Where.java at Where.java, I found an error with orderBy. As per https://www.sqlite.org/lang_select.html, it is not DSC, but DESC.
/**
* Defines a SQL ORDER BY statement without the ORDER BY.
*
* @param ascending If we should be in ascending order
* @return
*/
public Where<ModelClass> orderBy(boolean ascending, String... columns) {
mOrderBy = new QueryBuilder().appendArray(columns).appendSpace().append(ascending ? "ASC" : "DSC").getQuery();
return this;
}
This should be the following:
/**
* Defines a SQL ORDER BY statement without the ORDER BY.
*
* @param ascending If we should be in ascending order
* @return
*/
public Where<ModelClass> orderBy(boolean ascending, String... columns) {
mOrderBy = new QueryBuilder().appendArray(columns).appendSpace().append(ascending ? "ASC" : "DESC").getQuery();
return this;
}
Otherwise, you get an error like this:
E/SQLiteLog﹕ (1) near "DSC": syntax error
@jparkie good find! will be in 1.0.2 within the hour