[odb-users] ODB Query using relation

Adrian Imboden mail at adrianimboden.ch
Wed Jan 8 05:36:02 EST 2014


On 08.01.2014 08:04, Boris Kolpackov wrote:
> Hi Adrian,
>
> Adrian Imboden <mail at adrianimboden.ch> writes:
>
>>> This one is a bit trickier since ODB does not yet support querying
>>> of containers.
>> Is there already some idea how to implement this feature? If there is
>> need, I could invest some time too.
> The hard part is exactly that: figuring out what the proper semantics
> and the syntax to go with it are and how to implement them.
>
> When people are using a container in a query condition, we need to
> know which elements to consider. This can be some specific element
> (e.g., the first element), any element, all elements, a range of
> elements, etc.
>
> I think the "any element" will be the most widely used case and is
> the one we definitely have to support. Others, I am not sure it will
> even be possible to implement in SQL in any sane way (e.g., all
> elements, a range of elements). Maybe what we should do is expose
> the index column (or the key column for maps) to the user so that
> they can create whatever conditions they want. Something along
> these lines:
>
> query::authTokens.index == 0 && query::authTokens->hash == 123
>
> [Note the problem with this syntax: a container element may also
> have a data member named index.]
>
> It is also not clear how to implement the "all elements" case
> with this approach, or in SQL in a sane/portable way in general.
>
> So, as you can see, there are a lot of questions that need
> thinking and answering ;-). If you (or anyone else) want to
> spend some time on that, we can try to flesh this feature out.
>
> Boris
>
I will use the library a little bit more at first, to get a better 
feeling. I might come back to it later :)

Adi



More information about the odb-users mailing list