avoid complex macros with goto -> make 'goto' very obvious
brackets around single line if-statements are currently not included - because the line count of the backend-db file would increase by a factor around 2. If requested, I would add those brackets - or write a goto Makro including a condition like '#define j_goto_if(label,condition)' where condition might be a function call.
if the macro
define j_goto(label)
could be defined somewhere globally, it would be much easier to include temporary (not merged) debugging logs at a central location instead of the requirement to modify everything everywhere for debugging. - I know there are tools like gdb, but it is much faster to let multiple parallel instances just write some logs and grep them later.
This code adds wrapper code for bson, because at multiple locations the bson just return false if an error occurs. the wrapper, adds text-based error messages to the otherwise useless 'return false'
Together with the sql-wrapper the exchange of dynamically typed data between sql and bson is much cleaner and can be debugged at a central place. - 'central' means once for each db-type like sqlite/mysql/posgres ...
I am still not convinced by the BSON wrapper. It still checks for programming errors that libbson also checks for. I have moved it into the db backend for now (the error codes now live in JBackend).
We cannot put it into the core library in its current form as it depends on the db client.
Headers should not contain variable names in function declarations. This might be problematic if the variable name is a reserved keyword in C++.
Datatypes should be consistent with the rest of JULEA (for example, gchar const* instead of const char*).
remove unnecessary error codes
avoid complex macros with goto -> make 'goto' very obvious
brackets around single line if-statements are currently not included - because the line count of the backend-db file would increase by a factor around 2. If requested, I would add those brackets - or write a goto Makro including a condition like '#define j_goto_if(label,condition)' where condition might be a function call.
if the macro
define j_goto(label)
could be defined somewhere globally, it would be much easier to include temporary (not merged) debugging logs at a central location instead of the requirement to modify everything everywhere for debugging. - I know there are tools like gdb, but it is much faster to let multiple parallel instances just write some logs and grep them later.
This code adds wrapper code for bson, because at multiple locations the bson just return false if an error occurs. the wrapper, adds text-based error messages to the otherwise useless 'return false'
Together with the sql-wrapper the exchange of dynamically typed data between sql and bson is much cleaner and can be debugged at a central place. - 'central' means once for each db-type like sqlite/mysql/posgres ...