diff --git a/README.md b/README.md index 2996ca6..35efcce 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ This is a Client SDK for RelationalAI -- API version: 1.2.6 +- API version: 1.2.7 ## Frameworks supported -- .NET Core 3.1+ +- .NET Core 5.0+ ## Dependencies diff --git a/RelationalAI/Connection.cs b/RelationalAI/Connection.cs index 1ff6f01..1fd9895 100644 --- a/RelationalAI/Connection.cs +++ b/RelationalAI/Connection.cs @@ -364,6 +364,12 @@ public bool EnableLibrary(string srcName) return Client.EnableLibrary(srcName); } + public bool CloseDatabase() + { + SetConnectionOnClients(); + return Client.CloseDatabase(); + } + public ICollection Cardinality(string relName = null) { SetConnectionOnClients(); diff --git a/RelationalAI/GeneratedRelationalAIClient.cs b/RelationalAI/GeneratedRelationalAIClient.cs index b3b07f6..a6c2fd7 100644 --- a/RelationalAI/GeneratedRelationalAIClient.cs +++ b/RelationalAI/GeneratedRelationalAIClient.cs @@ -842,6 +842,9 @@ public System.Collections.Generic.IDictionary AdditionalProperti [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.24.0 (Newtonsoft.Json v12.0.0.0)")] public partial class ModifyWorkspaceAction : Action { + [Newtonsoft.Json.JsonProperty("close_database", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Close_database { get; set; } + [Newtonsoft.Json.JsonProperty("delete_edb", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Delete_edb { get; set; } diff --git a/RelationalAI/KGMSClient.cs b/RelationalAI/KGMSClient.cs index 782ef70..34a328a 100644 --- a/RelationalAI/KGMSClient.cs +++ b/RelationalAI/KGMSClient.cs @@ -21,7 +21,7 @@ public partial class GeneratedRelationalAIClient public const string JSON_CONTENT_TYPE = "application/json"; public const string CSV_CONTENT_TYPE = "text/csv"; - public const string USER_AGENT_HEADER = "KGMSClient/1.2.1/csharp"; + public const string USER_AGENT_HEADER = "KGMSClient/1.2.7/csharp"; public int DebugLevel = Connection.DEFAULT_DEBUG_LEVEL; @@ -895,6 +895,13 @@ public bool EnableLibrary(string srcName) return RunAction(action) != null; } + public bool CloseDatabase() + { + var action = new ModifyWorkspaceAction(); + action.Close_database = conn.DbName; + return RunAction(action, isReadOnly: true) != null; + } + public ICollection Cardinality(string relName = null) { var action = new CardinalityAction(); diff --git a/RelationalAI/RelationalAI.csproj b/RelationalAI/RelationalAI.csproj index 7c29d44..daa75f2 100644 --- a/RelationalAI/RelationalAI.csproj +++ b/RelationalAI/RelationalAI.csproj @@ -1,7 +1,7 @@ - 1.2.6 + 1.2.7 net5.0 RelationalAI RelationalAI diff --git a/RelationalAISamples/LocalWorkflow.cs b/RelationalAISamples/LocalWorkflow.cs index e77e09d..9c5ba09 100644 --- a/RelationalAISamples/LocalWorkflow.cs +++ b/RelationalAISamples/LocalWorkflow.cs @@ -56,6 +56,7 @@ def jaccard_similarity(a,b,v) = (count[x : tmp(a,b,x)] / count[x: (uedge(a, x) o ); Console.WriteLine("==> Jaccard Similarity: " + JObject.FromObject(queryResult).ToString()); + conn.CloseDatabase(); } } diff --git a/RelationalAITests/IntegrationTestsCommons.cs b/RelationalAITests/IntegrationTestsCommons.cs index 88d423f..ab5164a 100644 --- a/RelationalAITests/IntegrationTestsCommons.cs +++ b/RelationalAITests/IntegrationTestsCommons.cs @@ -104,6 +104,12 @@ public static void RunAllTests(ConnFunc connFunc) conn.CreateDatabase(overwrite: true); Assert.True(conn.DeleteSource("stdlib")); + // close_database + // ============================================================================= + conn = connFunc(); + conn.CreateDatabase(overwrite: true); + Assert.True(conn.CloseDatabase()); + // list_source // ============================================================================= conn = connFunc(); diff --git a/default.nix b/default.nix index e901783..b43497f 100644 --- a/default.nix +++ b/default.nix @@ -9,7 +9,7 @@ let in stdenv.mkDerivation rec { name = "rai-server-csharp-client-sdk-${version}"; - version = "1.2.6"; + version = "1.2.7"; buildInputs = [ raiserverBinary dotnet-sdk_5