Skip to content

Commit d49d1db

Browse files
authored
9.1 Deployment (#73)
2 parents 06c8fe5 + 05cb652 commit d49d1db

20 files changed

Lines changed: 72 additions & 21 deletions

SQL_Adapter/AdapterActions/Execute.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -219,3 +219,4 @@ public Output<List<object>, bool> ExecuteCommand(IExecuteCommand command, Action
219219

220220

221221

222+

SQL_Adapter/AdapterActions/Pull.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -112,3 +112,4 @@ private Type GetDataType(IRequest request)
112112

113113

114114

115+

SQL_Adapter/AdapterActions/Push.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -215,3 +215,4 @@ private List<object> GetRowsToPush(IEnumerable<object> data, DataTable dataTable
215215

216216

217217

218+

SQL_Adapter/AdapterActions/Remove.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -48,3 +48,4 @@ public override int Remove(IRequest filter, ActionConfig actionConfig = null)
4848

4949

5050

51+

SQL_Adapter/Convert/ToDictionary.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -60,3 +60,4 @@ public static Dictionary<string, object> ToDictionary(object o)
6060

6161

6262

63+

SQL_Adapter/SQL_Adapter.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Authors>BHoM</Authors>
88
<Copyright>Copyright © https://github.com/BHoM</Copyright>
99
<RootNamespace>BH.Adapter.SQL</RootNamespace>
10-
<FileVersion>9.0.0.0</FileVersion>
10+
<FileVersion>9.1.0.0</FileVersion>
1111
<Configurations>Debug;Release;ZeroCodeTool</Configurations>
1212
<OutputPath>..\Build\</OutputPath>
1313
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

SQL_Adapter/SqlAdapter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -203,3 +203,4 @@ private List<string> GetTableColumns(SqlConnection connection, string table)
203203

204204

205205

206+

SQL_Engine/Compute/NewTableCommand.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -22,8 +22,10 @@
2222

2323
using BH.Engine.Base;
2424
using BH.oM.Base;
25+
using BH.oM.Base.Attributes;
2526
using System;
2627
using System.Collections.Generic;
28+
using System.ComponentModel;
2729
using System.Linq;
2830
using System.Reflection;
2931
using System.Text;
@@ -37,6 +39,10 @@ public static partial class Compute
3739
/**** Public Methods ****/
3840
/***************************************************/
3941

42+
[Description("Creates a SQL CREATE TABLE command string for the given object type, using its primitive, enum, string, Guid, and DateTime properties as columns.")]
43+
[Input("objectType", "The type from which to derive the SQL table columns.")]
44+
[Input("tableName", "The name for the SQL table. Defaults to the type name if not provided or empty.")]
45+
[Output("command", "SQL CREATE TABLE command string for the given type.")]
4046
public static string NewTableCommand(this Type objectType, string tableName = "")
4147
{
4248
if (objectType == null)
@@ -76,3 +82,4 @@ public static string NewTableCommand(this Type objectType, string tableName = ""
7682

7783

7884

85+

SQL_Engine/Convert/FromDictionary.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -20,14 +20,16 @@
2020
* along with this code. If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
2121
*/
2222

23+
using BH.Engine.Base;
2324
using BH.oM.Base;
25+
using BH.oM.Base.Attributes;
2426
using System;
2527
using System.Collections.Generic;
28+
using System.ComponentModel;
2629
using System.Linq;
2730
using System.Reflection;
2831
using System.Text;
2932
using System.Threading.Tasks;
30-
using BH.Engine.Base;
3133

3234
namespace BH.Engine.SQL
3335
{
@@ -37,6 +39,10 @@ public static partial class Convert
3739
/**** Public Methods ****/
3840
/***************************************************/
3941

42+
[Description("Creates an object instance from a dictionary of property name-value pairs. The target type is inferred from the _t key in the dictionary if not provided or abstract.")]
43+
[Input("dic", "Dictionary mapping property names to their values. Keys starting with _ are stored as CustomData on BHoMObjects.")]
44+
[Input("type", "The type of object to create. If null or abstract, the type is resolved from the _t key in the dictionary.")]
45+
[Output("obj", "An object instance populated with values from the dictionary.")]
4046
public static object FromDictionary(this Dictionary<string, object> dic, Type type = null)
4147
{
4248
if ((type == null || type.IsAbstract) && dic.ContainsKey("_t"))
@@ -72,3 +78,4 @@ public static object FromDictionary(this Dictionary<string, object> dic, Type ty
7278

7379

7480

81+

SQL_Engine/Convert/ToSqlCommand.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* This file is part of the Buildings and Habitats object Model (BHoM)
3-
* Copyright (c) 2015 - 2025, the respective contributors. All rights reserved.
3+
* Copyright (c) 2015 - 2026, the respective contributors. All rights reserved.
44
*
55
* Each contributor holds copyright over their respective contributions.
66
* The project versioning (Git) records all such contribution source information.
@@ -23,9 +23,11 @@
2323
using BH.oM.Adapter;
2424
using BH.oM.Adapters.SQL;
2525
using BH.oM.Base;
26+
using BH.oM.Base.Attributes;
2627
using BH.oM.Data.Requests;
2728
using System;
2829
using System.Collections.Generic;
30+
using System.ComponentModel;
2931
using System.Linq;
3032
using System.Reflection;
3133
using System.Text;
@@ -39,13 +41,19 @@ public static partial class Convert
3941
/**** Interface Methods ****/
4042
/***************************************************/
4143

44+
[Description("Converts an IRequest to its corresponding SQL command string.")]
45+
[Input("request", "The request to convert to a SQL command string.")]
46+
[Output("command", "SQL command string corresponding to the given request.")]
4247
public static string IToSqlCommand(this IRequest request)
4348
{
4449
return ToSqlCommand(request as dynamic);
4550
}
4651

4752
/***************************************************/
4853

54+
[Description("Converts an IExecuteCommand to its corresponding SQL command string.")]
55+
[Input("request", "The execute command to convert to a SQL command string.")]
56+
[Output("command", "SQL command string corresponding to the given execute command.")]
4957
public static string IToSqlCommand(this IExecuteCommand request)
5058
{
5159
return ToSqlCommand(request as dynamic);
@@ -56,6 +64,9 @@ public static string IToSqlCommand(this IExecuteCommand request)
5664
/**** Request Methods ****/
5765
/***************************************************/
5866

67+
[Description("Converts a TableRequest to a SQL SELECT command string, optionally filtering columns and rows.")]
68+
[Input("request", "The table request specifying the table, columns, and filter to query.")]
69+
[Output("command", "SQL SELECT command string for the given table request.")]
5970
public static string ToSqlCommand(this TableRequest request)
6071
{
6172
string select = "*";
@@ -71,6 +82,9 @@ public static string ToSqlCommand(this TableRequest request)
7182

7283
/***************************************************/
7384

85+
[Description("Converts a CustomRequest to a SQL command string by returning its Query property directly.")]
86+
[Input("request", "The custom request containing a raw SQL query string.")]
87+
[Output("command", "SQL command string from the custom request's Query property.")]
7488
public static string ToSqlCommand(this oM.Adapters.SQL.CustomRequest request)
7589
{
7690
return request.Query;
@@ -81,6 +95,9 @@ public static string ToSqlCommand(this oM.Adapters.SQL.CustomRequest request)
8195
/**** Command Methods ****/
8296
/***************************************************/
8397

98+
[Description("Converts an UpdateCommand to a SQL UPDATE command string, applying the specified field changes and optional filter.")]
99+
[Input("command", "The update command specifying the table, field changes, and optional filter condition.")]
100+
[Output("command", "SQL UPDATE command string for the given update command.")]
84101
public static string ToSqlCommand(this UpdateCommand command)
85102
{
86103
string where = "";
@@ -118,3 +135,4 @@ private static string ToSqlCommand(this object request)
118135

119136

120137

138+

0 commit comments

Comments
 (0)