This may not be important to you, but bear in mind that record Ids are an
opaque data element, and your code will break with other databases. I use
the whole string as the record key in Mnesia, and I suspect the (at least
some of) the non-SQL databases do the same thing.

Cheers,

g



On 31 December 2014 at 17:20, Evgeny M <[email protected]> wrote:

> Afaik there are no such mehods
>
> Just add a method
>
>  int_id() ->
>        [_, IId] = string:tokens(Id, "-"),
>        list_to_integer(IId).
>
> or something like this to your models.
>
> вторник, 30 декабря 2014 г., 0:51:38 UTC+3 пользователь aloharich написал:
>>
>> Using a model with BossDB, the "id" appears to prepend the table name,
>>
>> So   Model:id()  returns "model-1" for example.
>>
>> Some of our relationships can't be modeled completely with the ORM, so
>> additional raw queries are needed using the actual ID (ie 1, not model-1).
>>
>> Are there any methods or ways to configure the model to provide access to
>> the raw id (versus having to hack the :id() result to parse it).
>>
>  --
> 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/d933fe7a-b26d-4dbc-9aa2-d5a4732e0d4b%40googlegroups.com
> <https://groups.google.com/d/msgid/chicagoboss/d933fe7a-b26d-4dbc-9aa2-d5a4732e0d4b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKF5fiAVfCi6%3DbuZj2%3D6ek4JjKL9MqnG7jthNeAcgRtn5sg5AA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to