[odb-users] table_name in ODB 2.2.0

Boris Kolpackov boris at codesynthesis.com
Tue May 7 11:57:35 EDT 2013


Hi Reza,

Reza Jahanbakhshi <reza.jahanbakhshi at gmail.com> writes:

> First thanks for you answer. Due to limits in ODB query language we use a
> lot of custom queries in our project. Wouldn't it be nice to have a cleaner
> syntax to access object table name in ODB queries? Currently I'm thinking
> about writing a wrapper template function like odb_table_name<Object> ()
> and use is in our project. What do you suggest? Are you considering to put
> such facility in ODB in future?

Isn't it already pretty much what we have in ODB? That is, in the general
case, you need to provide two things in order to get the table name: the
object type and the database. I suppose we could use a default value for
the database to make life easier for people who are only using a single
database. So you would just write:

odb::object_traits_impl<Object>::table_name

Also, probably a better solution to this problem would be to provide ODB
support for the the kind of queries that you need. Can you show us some
examples?

Boris



More information about the odb-users mailing list