-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathIGraphCommands.cs
143 lines (129 loc) · 7.41 KB
/
IGraphCommands.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
using NRedisStack.Graph;
using StackExchange.Redis;
namespace NRedisStack
{
[Obsolete("RedisGraph is not supported since Redis 7.2 (https://redis.com/blog/redisgraph-eol/)")]
public interface IGraphCommands
{
/// <summary>
/// Execute a Cypher query with parameters.
/// </summary>
/// <param name="graphName">A graph to perform the query on.</param>
/// <param name="query">The Cypher query.</param>
/// <param name="parameters">Parameters map.</param>
/// <param name="timeout">Timeout (optional).</param>
/// <returns>A result set.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.query"/></remarks>
ResultSet Query(string graphName, string query, IDictionary<string, object> parameters, long? timeout = null);
/// <summary>
/// Execute a Cypher query.
/// </summary>
/// <param name="graphName">A graph to perform the query on.</param>
/// <param name="query">The Cypher query.</param>
/// <param name="timeout">Timeout (optional).</param>
/// <returns>A result set.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.query"/></remarks>
ResultSet Query(string graphName, string query, long? timeout = null);
/// <summary>
/// Execute a Cypher query with parameters.
/// </summary>
/// <param name="graphName">A graph to perform the query on.</param>
/// <param name="query">The Cypher query.</param>
/// <param name="parameters">Parameters map.</param>
/// <param name="timeout">Timeout (optional).</param>
/// <returns>A result set.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.ro_query"/></remarks>
ResultSet RO_Query(string graphName, string query, IDictionary<string, object> parameters, long? timeout = null);
/// <summary>
/// Execute a Cypher query.
/// </summary>
/// <param name="graphName">A graph to perform the query on.</param>
/// <param name="query">The Cypher query.</param>
/// <param name="timeout">Timeout (optional).</param>
/// <returns>A result set.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.ro_query"/></remarks>
ResultSet RO_Query(string graphName, string query, long? timeout = null);
// TODO: Check if needed
/// <summary>
/// Call a saved procedure.
/// </summary>
/// <param name="graphName">The graph containing the saved procedure.</param>
/// <param name="procedure">The procedure name.</param>
/// <param name="procedureMode">The mode of the saved procedure. Defaults to <see cref="ProcedureMode.Write"/>.</param>
/// <returns>A result set.</returns>
ResultSet CallProcedure(string graphName, string procedure, ProcedureMode procedureMode = ProcedureMode.Write);
/// <summary>
/// Call a saved procedure with parameters.
/// </summary>
/// <param name="graphName">The graph containing the saved procedure.</param>
/// <param name="procedure">The procedure name.</param>
/// <param name="args">A collection of positional arguments.</param>
/// <param name="procedureMode">The mode of the saved procedure. Defaults to <see cref="ProcedureMode.Write"/>.</param>
/// <returns>A result set.</returns>
ResultSet CallProcedure(string graphName, string procedure, IEnumerable<string> args, ProcedureMode procedureMode = ProcedureMode.Write);
/// <summary>
/// Call a saved procedure with parameters.
/// </summary>
/// <param name="graphName">The graph containing the saved procedure.</param>
/// <param name="procedure">The procedure name.</param>
/// <param name="args">A collection of positional arguments.</param>
/// <param name="kwargs">A collection of keyword arguments.</param>
/// <param name="procedureMode">The mode of the saved procedure. Defaults to <see cref="ProcedureMode.Write"/>.</param>
/// <returns>A result set.</returns>
ResultSet CallProcedure(string graphName, string procedure, IEnumerable<string> args, Dictionary<string, List<string>> kwargs, ProcedureMode procedureMode = ProcedureMode.Write);
/// <summary>
/// Delete an existing graph.
/// </summary>
/// <param name="graphName">The graph to delete.</param>
/// <returns><see langword="true"/> if executed correctly, error otherwise/></returns>
/// <remarks><seealso href="https://redis.io/commands/graph.delete"/></remarks>
bool Delete(string graphName);
/// <summary>
/// Constructs a query execution plan but does not run it. Inspect this execution plan to better understand how your
/// query will get executed.
/// </summary>
/// <param name="graphName">The graph name.</param>
/// <param name="query">The query.</param>
/// <returns>String representation of a query execution plan.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.explain"/></remarks>
IReadOnlyList<string> Explain(string graphName, string query);
/// <summary>
/// Executes a query and produces an execution plan augmented with metrics for each operation's execution.
/// </summary>
/// <param name="graphName">The graph name.</param>
/// <param name="query">The query.</param>
/// <param name="timeout">Timeout (optional).</param>
/// <returns>String representation of a query execution plan,
/// with details on results produced by and time spent in each operation.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.profile"/></remarks>
IReadOnlyList<string> Profile(string graphName, string query, long? timeout = null);
/// <summary>
/// Lists all graph keys in the keyspace.
/// </summary>
/// <returns>List of all graph keys in the keyspace.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.list"/></remarks>
IReadOnlyList<string> List();
/// <summary>
/// Set the value of a RedisGraph configuration parameter.
/// </summary>
/// <param name="configName">The config name.</param>
/// <param name="value">Value to set.</param>
/// <returns><see langword="true"/> if executed correctly, error otherwise</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.config-set"/></remarks>
bool ConfigSet(string configName, object value);
/// <summary>
/// Set the value of a RedisGraph configuration parameter.
/// </summary>
/// <param name="configName">The config name.</param>
/// <returns>Dictionary of <string, object>.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.config-get"/></remarks>
Dictionary<string, RedisResult> ConfigGet(string configName);
/// <summary>
/// Returns a list containing up to 10 of the slowest queries issued against the given graph Name.
/// </summary>
/// <param name="graphName">The graph name.</param>
/// <returns>Dictionary of <string, object>.</returns>
/// <remarks><seealso href="https://redis.io/commands/graph.slowlog"/></remarks>
List<List<string>> Slowlog(string graphName);
}
}