Skip to content

Commit

Permalink
Merge branch 'main' into feature/cli
Browse files Browse the repository at this point in the history
  • Loading branch information
RohitM-IN committed Mar 5, 2024
2 parents f0d2e2d + 0138f53 commit 9ebde2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/DbSyncKit.MySQL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<Nullable>enable</Nullable>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
<Version>1.2.0.0</Version>
<AssemblyVersion>1.4.0.0</AssemblyVersion>
<FileVersion>1.4.0.0</FileVersion>
<Version>1.4.0.0</Version>
<PackageProjectUrl>https://dbsynckit.rohit-mahajan.in/t</PackageProjectUrl>
<RepositoryUrl>https://github.com/RohitM-IN/DbSyncKit</RepositoryUrl>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
Expand Down
15 changes: 7 additions & 8 deletions src/QueryGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Collections.Generic;
using System.Reflection;
using System.Reflection;
using System.Text;
using DbSyncKit.DB.Helper;
using DbSyncKit.DB.Interface;
using DbSyncKit.Templates.Interface;
using DbSyncKit.Templates.MySql;
using Fluid;

Expand Down Expand Up @@ -81,7 +80,7 @@ public string GenerateComment(string comment)
/// <param name="entity">The entity object.</param>
/// <param name="keyColumns">The list of key columns for deletion.</param>
/// <returns>The generated SQL delete query.</returns>
public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns) where T : IDataContract
public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns)
{

string tableName = GetTableName<T>();
Expand All @@ -103,7 +102,7 @@ public string GenerateDeleteQuery<T>(T entity, List<string> keyColumns) where T
/// <param name="keyColumns">The list of key columns for insertion.</param>
/// <param name="excludedColumns">The list of columns to exclude from insertion.</param>
/// <returns>The generated SQL insert query.</returns>
public string GenerateInsertQuery<T>(T entity, List<string> keyColumns, List<string> excludedColumns) where T : IDataContract
public string GenerateInsertQuery<T>(T entity, List<string> keyColumns, List<string> excludedColumns)
{
string tableName = GetTableName<T>();
string schemaName = GetTableSchema<T>() ?? DEFAULT_SCHEMA_NAME;
Expand Down Expand Up @@ -137,7 +136,7 @@ public string GenerateInsertQuery<T>(T entity, List<string> keyColumns, List<str
/// <param name="ListOfColumns">The list of columns to select.</param>
/// <param name="schemaName">The schema name (if applicable).</param>
/// <returns>The generated SQL select query.</returns>
public string GenerateSelectQuery<T>(string tableName, List<string> ListOfColumns, string schemaName) where T : IDataContract
public string GenerateSelectQuery<T>(string tableName, List<string> ListOfColumns, string schemaName)
{
if (string.IsNullOrEmpty(tableName) || ListOfColumns == null || ListOfColumns.Count == 0)
{
Expand Down Expand Up @@ -166,7 +165,7 @@ public string GenerateSelectQuery<T>(string tableName, List<string> ListOfColumn
/// <param name="excludedColumns">The list of columns to exclude from update.</param>
/// <param name="editedProperties">The dictionary containing edited properties.</param>
/// <returns>The generated SQL update query.</returns>
public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, List<string> excludedColumns, (string propName, object propValue)[] editedProperties) where T : IDataContract
public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, List<string> excludedColumns, (string propName, object propValue)[] editedProperties)
{
string tableName = GetTableName<T>();

Expand All @@ -188,7 +187,7 @@ public string GenerateUpdateQuery<T>(T DataContract, List<string> keyColumns, Li
/// <param name="entity">The entity object.</param>
/// <param name="keyColumns">The list of key columns for the condition.</param>
/// <returns>The generated SQL condition.</returns>
public List<string> GetCondition<T>(T entity, List<string> keyColumns) where T : IDataContract
public List<string> GetCondition<T>(T entity, List<string> keyColumns)
{
Type entityType = typeof(T);
PropertyInfo[] keyProperties = GetKeyProperties<T>();
Expand Down

0 comments on commit 9ebde2d

Please sign in to comment.