| 1969 | } |
| 1970 | |
| 1971 | static int graph_edge_cursor_step(cbm_store_t *store, graph_edge_cursor_t *cursor) { |
| 1972 | int rc = sqlite3_step(cursor->stmt); |
| 1973 | if (rc == SQLITE_DONE) { |
| 1974 | cursor->has_row = false; |
| 1975 | return CBM_STORE_OK; |
| 1976 | } |
| 1977 | if (rc != SQLITE_ROW) { |
| 1978 | store_set_error_sqlite(store, "compare edge scan"); |
| 1979 | cursor->has_row = false; |
| 1980 | return rc == SQLITE_INTERRUPT ? CBM_STORE_CANCELLED : CBM_STORE_ERR; |
| 1981 | } |
| 1982 | cursor->identity.source.qualified_name = |
| 1983 | safe_str((const char *)sqlite3_column_text(cursor->stmt, 0)); |
| 1984 | cursor->identity.source.label = |
| 1985 | safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_1)); |
| 1986 | cursor->identity.source.file_path = |
| 1987 | safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_2)); |
| 1988 | cursor->identity.target.qualified_name = |
| 1989 | safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_3)); |
| 1990 | cursor->identity.target.label = |
| 1991 | safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_4)); |
| 1992 | cursor->identity.target.file_path = |
| 1993 | safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_5)); |
| 1994 | cursor->identity.type = safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_6)); |
| 1995 | cursor->identity.local_name_gen = |
| 1996 | safe_str((const char *)sqlite3_column_text(cursor->stmt, ST_COL_7)); |
| 1997 | cursor->has_row = true; |
| 1998 | return CBM_STORE_OK; |
| 1999 | } |
| 2000 | |
| 2001 | static int graph_prepare_node_cursor(cbm_store_t *store, const char *project, |
| 2002 | graph_node_cursor_t *cursor) { |
no test coverage detected