Commit e5bb1da
committed
Return Cypher query results as objects from Query#run
Add an object-returning `Rubydex::Query#run(graph)` alongside the existing
string-returning `Query#render`. Where `render` formats rows into a table
or JSON string, `run` returns an `Array<Hash>` whose values are real Ruby
objects — including `Rubydex::Declaration`/`Definition`/`Document` handles
for node columns — so callers can navigate the graph directly instead of
re-parsing formatted text.
- cypher-parser 0.4: add `GraphProvider#node_id` and a `CypherValue::Node
{ id, label, name }` variant carrying an opaque node id.
- rubydex schema: implement `node_id` and `NodeRef::decode` over the
`decl:/def:/doc:<u64>` id scheme.
- FFI: add `rdx_query_run_rows`/`rdx_result_set_free` exposing a structured
`CResultSet`/`CCell` result instead of a preformatted string.
- Gem: `Query#run` builds `Array<Hash>`, decoding node cells back into the
appropriate Declaration/Definition/Document handles.1 parent bc2a231 commit e5bb1da
8 files changed
Lines changed: 460 additions & 30 deletions
File tree
- ext/rubydex
- rbi
- rust
- rubydex-sys/src
- rubydex
- src/query/cypher
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
847 | 848 | | |
848 | 849 | | |
849 | 850 | | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
850 | 929 | | |
851 | 930 | | |
852 | 931 | | |
| |||
886 | 965 | | |
887 | 966 | | |
888 | 967 | | |
| 968 | + | |
889 | 969 | | |
890 | 970 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
284 | 287 | | |
285 | 288 | | |
286 | 289 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments