futuresimple/android-db-commons — pull request #21 by chalup (2013-12-08 11:17:17+00:00)
Title: Fluent cursor api fixup

The toFirstRow method was introduced to prevent unnecessary Cursor iteration when user is interested only in getting the single row. This reasoning for adding this function is flawed though, because it encourages fetching potentially large cursor and using only first row instead of using LIMIT SQL clause. Moreover, the method signature is wrong: it's not possible to tell if the Optional.absent was returned from this function because there was no first row or because the row was converted to null value.

This pull request replaces toFirstRow method with more reasonable toOnlyElement functions.