MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / setup_cypher_http_store

Function setup_cypher_http_store

tests/test_cypher.c:1810–1850  ·  view source on GitHub ↗

Helper: set up store with HTTP_CALLS edge having properties. * Creates same graph as setup_cypher_store + one HTTP_CALLS edge. */

Source from the content-addressed store, hash-verified

1808/* Helper: set up store with HTTP_CALLS edge having properties.
1809 * Creates same graph as setup_cypher_store + one HTTP_CALLS edge. */
1810static cbm_store_t *setup_cypher_http_store(void) {
1811 cbm_store_t *s = cbm_store_open_memory();
1812 cbm_store_upsert_project(s, "test", "/tmp/test");
1813
1814 cbm_node_t n1 = {.project = "test",
1815 .label = "Function",
1816 .name = "HandleOrder",
1817 .qualified_name = "test.main.HandleOrder",
1818 .file_path = "main.go",
1819 .start_line = 10,
1820 .end_line = 30};
1821 cbm_node_t n2 = {.project = "test",
1822 .label = "Function",
1823 .name = "ValidateOrder",
1824 .qualified_name = "test.service.ValidateOrder",
1825 .file_path = "service.go",
1826 .start_line = 5,
1827 .end_line = 20};
1828 cbm_node_t n3 = {.project = "test",
1829 .label = "Function",
1830 .name = "SubmitOrder",
1831 .qualified_name = "test.service.SubmitOrder",
1832 .file_path = "service.go",
1833 .start_line = 25,
1834 .end_line = 50};
1835
1836 int64_t id1 = cbm_store_upsert_node(s, &n1);
1837 cbm_store_upsert_node(s, &n2);
1838 int64_t id3 = cbm_store_upsert_node(s, &n3);
1839
1840 cbm_edge_t http = {
1841 .project = "test",
1842 .source_id = id1,
1843 .target_id = id3,
1844 .type = "HTTP_CALLS",
1845 .properties_json =
1846 "{\"url_path\":\"/api/orders\",\"confidence\":0.85,\"method\":\"POST\"}"};
1847 cbm_store_insert_edge(s, &http);
1848
1849 return s;
1850}
1851
1852/* Helper: set up store with TWO HTTP_CALLS edges for filtering tests. */
1853static cbm_store_t *setup_cypher_multi_edge_store(void) {

Callers 2

test_cypher.cFile · 0.85

Calls 4

cbm_store_open_memoryFunction · 0.85
cbm_store_upsert_projectFunction · 0.85
cbm_store_upsert_nodeFunction · 0.85
cbm_store_insert_edgeFunction · 0.85

Tested by

no test coverage detected