+fun countVoters pol =
+ case C.oneRow (getDb ()) ($`SELECT COUNT(DISTINCT usr)
+ FROM Vote JOIN PollChoice ON id = cho AND pol = ^(C.intToSql pol)`) of
+ [count] => C.intFromSql count
+ | row => Init.rowError ("countVoters", row)
+
+fun listPollVoters pol =
+ C.map (getDb ()) mkUserRow ($`SELECT DISTINCT WebUser.id, name, rname, bal, joined, app, shares
+ FROM WebUser, Vote JOIN PollChoice ON cho = PollChoice.id
+ WHERE pol = ^(C.intToSql pol)
+ AND usr = WebUser.id
+ ORDER BY name`)
+
+end