Rich_Morin
Capturing "mix xref ..." output for use with a graph database?
I’d like to write a custom mix task to capture some “mix xref …” output and rework it for use with a graph database such as Neo4j. Looking at the docs for mix xref, I get the impression that it really wants to print on standard output. The only exception I see is a hard-coded option to (over)write xref_graph.dot in the current directory.
What is the cleanest way to run mix tasks and capture their output? Alternatively, should I simply extract the relevant code from mix xref? Suggestions welcome…
Most Liked
josevalim
Maybe you can try using a project to convert .dot files into cypher statements, such as: GitHub - jexp/dot2cypher: Convert GraphViz dot files into Cypher CREATE statements · GitHub
Another option is to add a CSV format that is just from,to,label, so it is easier to import and transform.
josevalim
mix xref is a command-line tool first and foremost. You should be able to redirect the output using standard Unix tools too.
LostKobrakai
Last Post!
Exadra37
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









