OpenBazaar/OpenBazaar — pull request #772 by freamon (2014-10-10 07:42:42+00:00)
Title: Make WHERE clause optional for SQL UPDATE calls

Hi,

I was looking into issue #733 - I think market_id can be completely removed with no functional difference and result in cleaner code, but a side effect of doing so is that UPDATE calls to the 'settings' table no longer have a convenient value for the WHERE clause. Since 'settings' only ever has one row, any value is a bit redundant. Therefore, I'd like to amend Obdb.updateEntries() so the where_dict parameter can be optional. As this involves changing the parameter order, all calls to it have been changed too.

I'd like to make this change first, and then remove market_id in a later PR, to avoid having too many changes at once.

My only concern is that, in its current implementation, updateEntries() guards against the caller accidently forgetting to include a WHERE clause and changing a whole table rather than one row. I don't know if this is a precautionary measure you want to keep.

Also, I don't know if there is anybody who wants to keep market_id.

Thanks.