ErlyORM / boss_db

BossDB: a sharded, caching, pooling, evented ORM for Erlang
Other
277 stars 138 forks source link

boss_db doc says find returns {error, reason} for error. It returns "undefined" (or throws exception) #259

Open RobertSwirsky opened 8 years ago

RobertSwirsky commented 8 years ago

Just a documentation bug from here: http://chicagoboss.org/doc/api-db.html as referenced in readme.md

There's only one record in device_setting, device_setting-1. One of its fields is guid.

(boss_client@master1)13>  boss_db:find("device_setting-2.guid").
undefined

(boss_client@master1)14>  boss_db:find("device_setting-1.guid").
<<"8MTWU">>

% try for an unknown column, foo, we get exception

(boss_client@master1)15>  boss_db:find("device_setting-1.foo"). 
** exception error: undefined function device_setting:foo/1
     in function  lists:foldl/3 (lists.erl, line 1262)
(boss_client@master1)16> 14:50:34.501 [info] Query SELECT * FROM device_settings WHERE id = 1

I've never seen {error, _} come out of find. Just either "undefined" or an exception.