![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Checked wrappers around the sqlite3_* calls: trace the statement, assert the return code, report the connection's error message when it is not SQLITE_OK.
More...
Include dependency graph for sql_debug.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | __DT_DEBUG_SQL_QUERY__(value) |
| #define | __DT_DEBUG_ASSERT__(xin) |
| #define | __DT_DEBUG_ASSERT_WITH_QUERY__(xin, query) |
| #define | DT_DEBUG_SQLITE3_EXEC(a, b, c, d, e) |
| #define | DT_DEBUG_SQLITE3_PREPARE_V2(a, b, c, d, e) |
| #define | DT_DEBUG_SQLITE3_BIND_INT(a, b, c) __DT_DEBUG_ASSERT__(sqlite3_bind_int(a, b, c)) |
| #define | DT_DEBUG_SQLITE3_BIND_INT64(a, b, c) __DT_DEBUG_ASSERT__(sqlite3_bind_int64(a, b, c)) |
| #define | DT_DEBUG_SQLITE3_BIND_DOUBLE(a, b, c) __DT_DEBUG_ASSERT__(sqlite3_bind_double(a, b, c)) |
| #define | DT_DEBUG_SQLITE3_BIND_TEXT(a, b, c, d, e) __DT_DEBUG_ASSERT__(sqlite3_bind_text(a, b, c, d, e)) |
| #define | DT_DEBUG_SQLITE3_BIND_BLOB(a, b, c, d, e) __DT_DEBUG_ASSERT__(sqlite3_bind_blob(a, b, c, d, e)) |
| #define | DT_DEBUG_SQLITE3_CLEAR_BINDINGS(a) __DT_DEBUG_ASSERT__(sqlite3_clear_bindings(a)) |
| #define | DT_DEBUG_SQLITE3_RESET(a) __DT_DEBUG_ASSERT__(sqlite3_reset(a)) |
Checked wrappers around the sqlite3_* calls: trace the statement, assert the return code, report the connection's error message when it is not SQLITE_OK.
src/database – every file that issues a query includes it, and every one of those is a translation unit holding a raw sqlite3 * that the module cannot account for. tools/check_module_boundaries.sh ratchets the number of such files downwards; the header is deleted when the count reaches zero and the macros become private to the repositories.So: do not include this from new code. A new query belongs in a repository under src/database/, reached through a named function. See src/database/README.md.
common/debug.h, which meant that a file wanting nothing but DT_DEBUG_TRACE_WRAPPER – a generic tracing helper with no relation to SQL – pulled in database.h and <sqlite3.h> as well. That was 42 translation units, of which 5 never issued a query. common/debug.h now carries only the tracing wrapper. Definition in file sql_debug.h.
| #define __DT_DEBUG_ASSERT__ | ( | xin | ) |
Definition at line 106 of file sql_debug.h.
| #define __DT_DEBUG_SQL_QUERY__ | ( | value | ) |
Definition at line 77 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_BIND_BLOB | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e | |||
| ) | __DT_DEBUG_ASSERT__(sqlite3_bind_blob(a, b, c, d, e)) |
Definition at line 149 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_BIND_DOUBLE | ( | a, | |
| b, | |||
| c | |||
| ) | __DT_DEBUG_ASSERT__(sqlite3_bind_double(a, b, c)) |
Definition at line 147 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_BIND_INT | ( | a, | |
| b, | |||
| c | |||
| ) | __DT_DEBUG_ASSERT__(sqlite3_bind_int(a, b, c)) |
Definition at line 145 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_BIND_INT64 | ( | a, | |
| b, | |||
| c | |||
| ) | __DT_DEBUG_ASSERT__(sqlite3_bind_int64(a, b, c)) |
Definition at line 146 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_BIND_TEXT | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e | |||
| ) | __DT_DEBUG_ASSERT__(sqlite3_bind_text(a, b, c, d, e)) |
Definition at line 148 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_CLEAR_BINDINGS | ( | a | ) | __DT_DEBUG_ASSERT__(sqlite3_clear_bindings(a)) |
Definition at line 150 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_EXEC | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e | |||
| ) |
Definition at line 129 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_PREPARE_V2 | ( | a, | |
| b, | |||
| c, | |||
| d, | |||
| e | |||
| ) |
Definition at line 137 of file sql_debug.h.
| #define DT_DEBUG_SQLITE3_RESET | ( | a | ) | __DT_DEBUG_ASSERT__(sqlite3_reset(a)) |
Definition at line 151 of file sql_debug.h.