Skip to content

Commit 8ab48b3

Browse files
author
daniel.yuan
committed
feat: add stored procedure interface for query execution
1 parent 1d2a00b commit 8ab48b3

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

src/Plugins/BotSharp.Plugin.Membase/Interfaces/IMembaseApi.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,9 @@ public interface IMembaseApi
6262
[Post("/graph/{graphId}/pgt-external/{correlationId}/complete")]
6363
Task<PgtExternalCompleteResponse> CompletePgtExternalAsync(string graphId, string correlationId, [FromBody] object emptyBody);
6464
#endregion
65+
66+
#region Procedure
67+
[Post("/graph/{graphId}/procedures/{procedureName}/execute")]
68+
Task<ProcedureExecuteResponse> ExecuteProcedureAsync(string graphId, string procedureName, [Body] ProcedureExecuteRequest? request = null);
69+
#endregion
6570
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace BotSharp.Plugin.Membase.Models;
2+
3+
public class ProcedureExecuteRequest
4+
{
5+
public Dictionary<string, object?> Parameters { get; set; } = [];
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace BotSharp.Plugin.Membase.Models;
4+
5+
public class ProcedureExecuteResponse
6+
{
7+
public string[] Columns { get; set; } = [];
8+
public Dictionary<string, object?>[] Data { get; set; } = [];
9+
10+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
11+
public PgtStatistics? Statistics { get; set; }
12+
13+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
14+
public object? ExecutionPlan { get; set; }
15+
16+
public CypherNotification[] Notifications { get; set; } = [];
17+
public int RowCount { get; set; }
18+
19+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
20+
public DateTime? ExecutedAt { get; set; }
21+
}

0 commit comments

Comments
 (0)