Page 1 of 1

QxEntityEditor SQLite default values

PostPosted: Tue Jun 20, 2017 7:37 am
by mdw
I have a SQLite DB project with the import option Import columns default value enabled. This is usually fine, but I have also timestamp columns with default value CURRENT_TIMESTAMP. Although perfectly valid in SQL, it makes not sense in the entity schema and far less in the generated C++ code, which does not compile.
For now I always cancel such special default values after doing the import. Does there exist some better alternative to ignore such "functional" default values?

Re: QxEntityEditor SQLite default values

PostPosted: Wed Jun 21, 2017 8:19 am
by qxorm
Hello,

I don't know what is the best way to manage that, but you could :
- Execute a custom script after your import process to remove these values (a *.qxee project file is just a SQLite database) : https://www.qxorm.com/qxorm_en/manual_q ... gin_script
- Or manage these values during the C++ export process in a javascript file (to be sure that your C++ code compiles fine) : https://www.qxorm.com/qxorm_en/manual_q ... #js_engine
- Or create a macro in your C++ code, something like that :
Code: Select all
#define CURRENT_TIMESTAMP QDateTime::currentDateTime()