Postgres JSON (BSON) fields

Forum for posting problems using QxOrm library

Postgres JSON (BSON) fields

Postby zawisza » Tue Feb 17, 2015 8:18 am

Hi!

I'm wondering if I can use postgresql json fields operators ( http://www.postgresql.org/docs/9.4/stat ... -json.html ) in search queries, in QxORM library? I didn't see any example of doing such a thing, is it possible?
And what about postgres table inharitance?
zawisza
 
Posts: 1
Joined: Tue Feb 17, 2015 8:13 am

Re: Postgres JSON (BSON) fields

Postby qxorm » Thu Feb 19, 2015 2:52 pm

Hello,

To build queries, QxOrm library provides the qx::QxSqlQuery class (or its qx_query alias) : http://www.qxorm.com/doxygen/html/class ... query.html
There is a FAQ here : http://www.qxorm.com/qxorm_en/faq.html#faq_210
If you want to use a special feature provided by your SGBD (like JSON for example), you can use the freeText() method of qx::QxSqlQuery class.

Or you can also write your SQL query manually and use qx::dao::call_query() or qx::dao::execute_query() functions.
You can also use directly the QtSql module if you prefer because QxOrm library is based on QtSql.

About PostgreSQL table inheritance, I would recommend to :
1- define your tables with pgAdmin or another tool ;
2- donwload and execute QxEntityEditor application ;
3- try the QxEntityEditor import plugin to load your tables into a QxEntityEditor project ;
4- then you can export it to a C++/Qt project, and see how classes are mapped to the inherited tables.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 5 guests

cron