aspen icon indicating copy to clipboard operation
aspen copied to clipboard

Add query manager

Open beechnut opened this issue 3 years ago • 0 comments

I'd like to add someplace—a queries.yml in an appropriate location—that stores plain-language queries and their Cypher equivalents. The CLI could then be used to run them, either by number or by text. There's templating built into it, so you can write a query for a specific person, etc.

$ aspen queries:list

1)  Who supervises the most people?
2)  Who does { Person } supervise?
3)  Order teams by psychological safety metrics.

$ aspen query 1
    > MATCH ... # Cypher goes here

Hickory

$ aspen query Who does Holly supervise?
    > MATCH ... # Cypher goes here

Magnolia
Cottonwood
Apple

The queries would be defined sort of like this, I imagine:

-
  name: Who does { Person } supervise?
  intake: Who does { Person a } supervise?
  query: |
    WITH (Person { name: {{{a}}} }) as supervisor ...

beechnut avatar Dec 08 '21 15:12 beechnut