This is definitely a hairy situation, and trying to selectively parse
out the "account-1" could certainly lead to issues, since "account-1"
is a perfectly valid string.

I'm not sure the best way to handle this kind of situation.

Perhaps the simple solution, rather than manually tokenizing the
string each time would be a simple function like
boss_db:extract_id(Id), then you could at least use that.

Alternatively, supporting boss_db:find(game_mark, [{AccountId},
{Gameid}]) where AccountId (having the format "account-1"), gets
parsed out as {account_id, equals, IntegerID}.

That might be a reasonable option to add some brevity, though not
entirely sure what folks think of that.


On Sun, Jul 20, 2014 at 10:45 AM, Caiyun Deng <[email protected]> wrote:
> Hi!
> boss_db:find(game_mark, [{account_id, equals, AccountId}, {game_id, equals,
> GameId}]).
> It excute"SELECT * FROM game_marks WHERE game_id = 'game-5' AND account_id =
> 'account-1' AND  TRUE ORDER BY id ASC";
> But i want it to excute"SELECT * FROM game_marks WHERE game_id = 5 AND
> account_id = 1 AND  TRUE ORDER BY id ASC"
> Except this:
> [_Pre, TrueAccountId]" = string.tokens("account-5", "-").
>
> Could you tell me is there other better method to do this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/ee64417d-d7f3-43c4-a7f3-750267f240aa%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/CAPTXyXcMuKkPtv7xg4m6H%3Dsc75C3WCTgkJ-zHG8z8G9W3-ET1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to