parcio / julea

A Flexible Storage Framework for HPC
GNU Lesser General Public License v3.0
33 stars 31 forks source link

Cleanup db backend #43

Closed Qualenritter closed 5 years ago

Qualenritter commented 5 years ago

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 ...

michaelkuhn commented 5 years ago

I have finally merged this. A few comments: