Skip to content

Commit

Permalink
SQLWrapper 2.1
Browse files Browse the repository at this point in the history
fix #5
fix #4
fix #3
  • Loading branch information
DAIKOZ committed Jul 8, 2024
1 parent 2d728f5 commit 11afa83
Show file tree
Hide file tree
Showing 15 changed files with 1,710 additions and 1,230 deletions.
30 changes: 26 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## [2.1] (2024-07-08)

### SQLWrapper
- **break changes** Modify command line name for better understanding
- Add Linux support (Debian 12)
- Generate stored procedure and function wrapper for mysql/mariadb
- Fix error with mariadb/mysql function: UNIX_TIMESTAMP
- Fix #3 error with mariadb/mysql function: SUBSTR
- Fix error with mariadb/mysql: EXISTS
- Fix line break when generate XML request

### Daikoz.SQLWrapper NuGet Package
- **break changes** Modify sqlwrapper.json configuration for better understanding
- Add Linux support (Debian 12)

### Template
- **SQL C# ADO**: Replace mysqlconnector by DbConnection to allow use this template with other database.
- **Database C#**: Generate stored procedure and function wrapper for mysql/mariadb
- **Database C#**: Replace mysqlconnector by DbConnection to allow use this template with other database.
- **Database C#**: Fix formating


## [2.0.1] (2024-04-12)

### SQLWrapper
Expand All @@ -14,7 +36,7 @@
- Update readme.md

### Template
- **C# Helper**: Use int type for length or long instead of uint to avoid int cast with index of string function.
- **C# Helper**: Rename SQLWrapper::UpdateIfModified to SQLWrapperHelper::UpdateIfModified method and move it in same namespace to avoid warning this Daikoz.SQLWrapper NuGet package.
- **C# Helper**: Fix tab/space mix
- **C# Helper**: Fix spaces
- **Database C#**: Use int type for length or long instead of uint to avoid int cast with index of string function.
- **Database C#**: Rename SQLWrapper::UpdateIfModified to SQLWrapperHelper::UpdateIfModified method and move it in same namespace to avoid warning this Daikoz.SQLWrapper NuGet package.
- **SQL C# ADO**: Fix tab/space mix
- **SQL C# ADO**: Fix spaces
74 changes: 49 additions & 25 deletions Daikoz.SQLWrapper/Daikoz.SQLWrapper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageIcon>sqlwrapper.png</PackageIcon>
<Title>SQL Wrapper Generator</Title>
<Version>2.0.1</Version>
<AssemblyVersion>2.0.1</AssemblyVersion>
<FileVersion>2.0.1</FileVersion>
<Version>2.1</Version>
<AssemblyVersion>2.1</AssemblyVersion>
<FileVersion>2.1</FileVersion>
<Authors>DAIKOZ</Authors>
<Description>SQLWrapper makes it easier to create code wrappers for SQL queries. It's a powerful tool that helps speed up development by reducing the need for manual coding. It works with databases various SQL database (MySQL, MariaDB, ...), checking the syntax and performance of SQL queries before you execute them.

Expand All @@ -28,27 +28,51 @@ Overall, DAIKOZ.SQLWrapper is a handy tool for making SQL code easier to work wi
<RepositoryUrl>https://github.com/daikoz/SQLWrapper</RepositoryUrl>
<RepositoryType>github</RepositoryType>
<PackageTags>sql;wrapper;sqlwrapper;ORM;dapper;linq;database;mysql;mariadb;server;mssql;pgsql;sqlite;postgres;postgresql;query;builder</PackageTags>
<PackageReleaseNotes># Changelog

## [2.0.1] (2024-04-12)

### SQLWrapper
- Order caseinsentive input SQL variables.
- Enhance display warning message
- MariaDB/MySQL: Fix UNION column checking with BOOL, INT, INTEGER type

### Daikoz.SQLWrapper NuGet Package
- Visual Studio can generate wrapper in background
- Fix compilation error after clean the project, the generated source is now added to compile process. Don't need to build again the project.
- Enhance display warning message
- Update readme.md

### Template
- **C# Helper**: Use int type for length or long instead of uint to avoid int cast with index of string function.
- **C# Helper**: Rename SQLWrapper::UpdateIfModified to SQLWrapperHelper::UpdateIfModified method and move it in same namespace to avoid warning this Daikoz.SQLWrapper NuGet package.
- **C# Helper**: Fix tab/space mix
- **C# Helper**: Fix spaces
</PackageReleaseNotes>
<PackageReleaseNotes>
# Changelog

## [2.1] (2024-07-08)

### SQLWrapper
- **break changes** Modify command line name for better understanding
- Add Linux support (Debian 12)
- Generate stored procedure and function wrapper for mysql/mariadb
- Fix error with mariadb/mysql function: UNIX_TIMESTAMP
- Fix #3 error with mariadb/mysql function: SUBSTR
- Fix error with mariadb/mysql: EXISTS
- Fix line break when generate XML request

### Daikoz.SQLWrapper NuGet Package
- **break changes** Modify sqlwrapper.json configuration for better understanding
- Add Linux support (Debian 12)

### Template
- **SQL C# ADO**: Replace mysqlconnector by DbConnection to allow use this template with other database.
- **Database C#**: Generate stored procedure and function wrapper for mysql/mariadb
- **Database C#**: Replace mysqlconnector by DbConnection to allow use this template with other database.
- **Database C#**: Fix formating


## [2.0.1] (2024-04-12)

### SQLWrapper
- Order caseinsentive input SQL variables.
- Enhance display warning message
- MariaDB/MySQL: Fix UNION column checking with BOOL, INT, INTEGER type

### Daikoz.SQLWrapper NuGet Package
- Visual Studio can generate wrapper in background
- Fix compilation error after clean the project, the generated source is now added to compile process. Don't need to build again the project.
- Enhance display warning message
- Update readme.md

### Template
- **Database C#**: Use int type for length or long instead of uint to avoid int cast with index of string function.
- **Database C#**: Rename SQLWrapper::UpdateIfModified to SQLWrapperHelper::UpdateIfModified method and move it in same namespace to avoid warning this Daikoz.SQLWrapper NuGet package.
- **SQL C# ADO**: Fix tab/space mix
- **SQL C# ADO**: Fix spaces

</PackageReleaseNotes>
<PackageLicenseFile>license.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>

Expand All @@ -74,7 +98,7 @@ Overall, DAIKOZ.SQLWrapper is a handy tool for making SQL code easier to work wi
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.9.5" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.10.4" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Daikoz.SQLWrapper/ErrorMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal class ErrorMessage
public static readonly (string ErrorCode, string Message) MsgConfigurationSQLWrapperToolNotFound = ("SW00506", "sqlwrapper executable not found in: {0}");
public static readonly (string ErrorCode, string Message) MsgSQLWrapperExecution = ("SW00507", "Error during execution of sqlwrapper: {0}");
public static readonly (string ErrorCode, string Message) MsgSQLWrapperHelperOutputFilePathNotDefined = ("SW00508", "Helper output filepath not defined");
public static readonly (string ErrorCode, string Message) MsgConfigurationDatabaseSectionNotDefined = ("SW00509", "No database defined");
public static readonly (string ErrorCode, string Message) MsgConfigurationDatabaseSectionNotDefined = ("SW00509", "No schema database defined");
public static readonly (string ErrorCode, string Message) MsgConfigurationDatabaseNotFound = ("SW00510", "Database name is not found: {0}");
public static readonly (string ErrorCode, string Message) MsgConfigurationHelperXSLTNotFound = ("SW00511", "XSLT helper file not found: {0}");
public static readonly (string ErrorCode, string Message) MsgSQLWrapperDirectoryNotFound = ("SW00512", "Path to search SQL files not found: {0}");
Expand Down
12 changes: 5 additions & 7 deletions Daikoz.SQLWrapper/Resource.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 26 additions & 19 deletions Daikoz.SQLWrapper/Resource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,37 @@
<data name="DefaultConfiguration" xml:space="preserve">
<value>{
"Verbose": false,
"Database": [
"Schema": [
{
"Name": "Name of this database. Should be contain only characters: a-z A-Z 0-9 _ -",
"ConnectionString": ".NET connection string to connect to database. If empty, use FilePath to get cached database previously generated.",
"FilePath": "File path of cached database. If empty, store it in obj of project"
"FilePath": "File path of cached database schema. If empty, store it in obj of project",
"CustomType": [
"SQLTable.SQLType=LanguageType",
"SQLColumnName=LanguageType",
"@SQLVariable=LanguageType"
]
}
],
"Helper": [
{
"Database": "Name of database defined in Database section",
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
"XLST": "Provide your own XLST to generate a helper. If empty, use default XLST provided by SQLWrapper",
"OutputFilePath": "File path of helper"
}
],
"Wrapper": [
{
"Database": "Name of database defined in Database section",
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
"XLST": "Provide your own XLST to generate the wrapper. If empty, use default XLST provided by SQLWrapper",
"Path": "Absolute or relative path where to search sql file pattern. If empty, use path of project",
"FilePattern": "SQL file to wrap. If empty, use \"*.sql\""
}
]
"Wrapper": {
"Database": [
{
"Schema": "Name of database schema defined in Schema section",
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
"XLST": "Provide your own XLST to generate a helper. If empty, use default XLST provided by SQLWrapper",
"OutputFilePath": "File path of schema"
}
],
"SQL": [
{
"Schema": "Name of database defined in Schema section",
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
"XLST": "Provide your own XLST to generate the wrapper. If empty, use default XLST provided by SQLWrapper",
"Path": "Absolute or relative path where to search sql file pattern. If empty, use path of project",
"FilePattern": "SQL file to wrap. If empty, use \"*.sql\""
}
]
}
}</value>
</data>
</root>
27 changes: 17 additions & 10 deletions Daikoz.SQLWrapper/SQLWrapperConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Daikoz.SQLWrapper
{
[DataContract]
internal class Database
internal class Schema
{
[DataMember]
public string? Name { get; set; }
Expand All @@ -20,10 +20,10 @@ internal class Database
}

[DataContract]
internal class Helper
internal class Database
{
[DataMember]
public string? Database { get; set; }
public string? Schema { get; set; }

[DataMember]
public string? Namespace { get; set; }
Expand All @@ -36,10 +36,10 @@ internal class Helper
}

[DataContract]
internal class Wrapper
internal class SQL
{
[DataMember]
public string? Database { get; set; }
public string? Schema { get; set; }

[DataMember]
public string? Namespace { get; set; }
Expand All @@ -56,19 +56,26 @@ internal class Wrapper
}

[DataContract]
internal class SQLWrapperConfig
internal class Wrapper
{
[DataMember]
public bool Verbose { get; set; } = false;
public List<Database>? Database { get; set; }

[DataMember]
public List<Database>? Database { get; set; }
public List<SQL>? SQL { get; set; }
}

[DataContract]
internal class SQLWrapperConfig
{
[DataMember]
public bool Verbose { get; set; } = false;

[DataMember]
public List<Helper>? Helper { get; set; }
public List<Schema>? Schema { get; set; }

[DataMember]
public List<Wrapper>? Wrapper { get; set; }
public Wrapper? Wrapper { get; set; }

}
}
Loading

0 comments on commit 11afa83

Please sign in to comment.