[odb-users] A view on top of several tables from different sqlite files (DB)

Weiss, Yoav yoav.weiss at intel.com
Wed Sep 2 07:42:52 EDT 2015


Hi,

My question is related to views with multiple tables like:
#pragma db view object (Cell = c) \
                object (Instance = i : c::m_id == i::m_cell_id) \
                query((?) + " GROUP BY " + c::m_name)
struct CellOccCount {
    #pragma db column("c.cell_name")
    std::string m_name;

    #pragma db column ("count(*)")
    long m_count;
};

And the way I query the view is:
odb::result<CellOccCount> results(m_p_db->query<CellOccCount>(query_cond));

Now suppose these 2 tables (Cell and Instance) are located in 2 different sqlite databases. My questions are:

1.       How should I modify the view (if at all) to reflect this?

2.       On which odb::database should I initiate the query (assuming I have 2 instances - one for each database)?

Thanks,

Yoav

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the odb-users mailing list