neo4j-rstats / neo4r

A Modern and Flexible Neo4J Driver
https://neo4j-rstats.github.io/user-guide/
Other
106 stars 29 forks source link

[Idea] Should the connection object keep track of every call? #26

Open ColinFay opened 6 years ago

ColinFay commented 6 years ago

We could set the con object to keep track of every call we are making to the API with this object, just to keep a kind of log file inside the object.

i.e : every time you run call_api("MY CALL", con), the con object get the time, the call, and the resulting stats.

'CREATE CONSTRAINT ON (d:Day) ASSERT d.name IS UNIQUE' %>%
  call_api(con, include_stats = TRUE)
# Will add to the con object : 
Call `CREATE CONSTRAINT ON (d:Day) ASSERT d.name IS UNIQUE` at XX
# A tibble: 12 x 2
   type                  value
   <chr>                 <dbl>
 1 contains_updates         1.
 2 nodes_created            0.
 3 nodes_deleted            0.
 4 properties_set           0.
 5 relationships_created    0.
 6 relationship_deleted     0.
 7 labels_added             0.
 8 labels_removed           0.
 9 indexes_added            0.
10 indexes_removed          0.
11 constraints_added        1.
12 constraints_removed      0.

Would it make sense?