Skip to content

Commit 11afa83

Browse files
author
DAIKOZ
committed
SQLWrapper 2.1
fix #5 fix #4 fix #3
1 parent 2d728f5 commit 11afa83

File tree

15 files changed

+1710
-1230
lines changed

15 files changed

+1710
-1230
lines changed

CHANGELOG.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## [2.1] (2024-07-08)
4+
5+
### SQLWrapper
6+
- **break changes** Modify command line name for better understanding
7+
- Add Linux support (Debian 12)
8+
- Generate stored procedure and function wrapper for mysql/mariadb
9+
- Fix error with mariadb/mysql function: UNIX_TIMESTAMP
10+
- Fix #3 error with mariadb/mysql function: SUBSTR
11+
- Fix error with mariadb/mysql: EXISTS
12+
- Fix line break when generate XML request
13+
14+
### Daikoz.SQLWrapper NuGet Package
15+
- **break changes** Modify sqlwrapper.json configuration for better understanding
16+
- Add Linux support (Debian 12)
17+
18+
### Template
19+
- **SQL C# ADO**: Replace mysqlconnector by DbConnection to allow use this template with other database.
20+
- **Database C#**: Generate stored procedure and function wrapper for mysql/mariadb
21+
- **Database C#**: Replace mysqlconnector by DbConnection to allow use this template with other database.
22+
- **Database C#**: Fix formating
23+
24+
325
## [2.0.1] (2024-04-12)
426

527
### SQLWrapper
@@ -14,7 +36,7 @@
1436
- Update readme.md
1537

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

Daikoz.SQLWrapper/Daikoz.SQLWrapper.csproj

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
1212
<PackageIcon>sqlwrapper.png</PackageIcon>
1313
<Title>SQL Wrapper Generator</Title>
14-
<Version>2.0.1</Version>
15-
<AssemblyVersion>2.0.1</AssemblyVersion>
16-
<FileVersion>2.0.1</FileVersion>
14+
<Version>2.1</Version>
15+
<AssemblyVersion>2.1</AssemblyVersion>
16+
<FileVersion>2.1</FileVersion>
1717
<Authors>DAIKOZ</Authors>
1818
<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.
1919

@@ -28,27 +28,51 @@ Overall, DAIKOZ.SQLWrapper is a handy tool for making SQL code easier to work wi
2828
<RepositoryUrl>https://github.com/daikoz/SQLWrapper</RepositoryUrl>
2929
<RepositoryType>github</RepositoryType>
3030
<PackageTags>sql;wrapper;sqlwrapper;ORM;dapper;linq;database;mysql;mariadb;server;mssql;pgsql;sqlite;postgres;postgresql;query;builder</PackageTags>
31-
<PackageReleaseNotes># Changelog
32-
33-
## [2.0.1] (2024-04-12)
34-
35-
### SQLWrapper
36-
- Order caseinsentive input SQL variables.
37-
- Enhance display warning message
38-
- MariaDB/MySQL: Fix UNION column checking with BOOL, INT, INTEGER type
39-
40-
### Daikoz.SQLWrapper NuGet Package
41-
- Visual Studio can generate wrapper in background
42-
- Fix compilation error after clean the project, the generated source is now added to compile process. Don't need to build again the project.
43-
- Enhance display warning message
44-
- Update readme.md
45-
46-
### Template
47-
- **C# Helper**: Use int type for length or long instead of uint to avoid int cast with index of string function.
48-
- **C# Helper**: Rename SQLWrapper::UpdateIfModified to SQLWrapperHelper::UpdateIfModified method and move it in same namespace to avoid warning this Daikoz.SQLWrapper NuGet package.
49-
- **C# Helper**: Fix tab/space mix
50-
- **C# Helper**: Fix spaces
51-
</PackageReleaseNotes>
31+
<PackageReleaseNotes>
32+
# Changelog
33+
34+
## [2.1] (2024-07-08)
35+
36+
### SQLWrapper
37+
- **break changes** Modify command line name for better understanding
38+
- Add Linux support (Debian 12)
39+
- Generate stored procedure and function wrapper for mysql/mariadb
40+
- Fix error with mariadb/mysql function: UNIX_TIMESTAMP
41+
- Fix #3 error with mariadb/mysql function: SUBSTR
42+
- Fix error with mariadb/mysql: EXISTS
43+
- Fix line break when generate XML request
44+
45+
### Daikoz.SQLWrapper NuGet Package
46+
- **break changes** Modify sqlwrapper.json configuration for better understanding
47+
- Add Linux support (Debian 12)
48+
49+
### Template
50+
- **SQL C# ADO**: Replace mysqlconnector by DbConnection to allow use this template with other database.
51+
- **Database C#**: Generate stored procedure and function wrapper for mysql/mariadb
52+
- **Database C#**: Replace mysqlconnector by DbConnection to allow use this template with other database.
53+
- **Database C#**: Fix formating
54+
55+
56+
## [2.0.1] (2024-04-12)
57+
58+
### SQLWrapper
59+
- Order caseinsentive input SQL variables.
60+
- Enhance display warning message
61+
- MariaDB/MySQL: Fix UNION column checking with BOOL, INT, INTEGER type
62+
63+
### Daikoz.SQLWrapper NuGet Package
64+
- Visual Studio can generate wrapper in background
65+
- Fix compilation error after clean the project, the generated source is now added to compile process. Don't need to build again the project.
66+
- Enhance display warning message
67+
- Update readme.md
68+
69+
### Template
70+
- **Database C#**: Use int type for length or long instead of uint to avoid int cast with index of string function.
71+
- **Database C#**: Rename SQLWrapper::UpdateIfModified to SQLWrapperHelper::UpdateIfModified method and move it in same namespace to avoid warning this Daikoz.SQLWrapper NuGet package.
72+
- **SQL C# ADO**: Fix tab/space mix
73+
- **SQL C# ADO**: Fix spaces
74+
75+
</PackageReleaseNotes>
5276
<PackageLicenseFile>license.txt</PackageLicenseFile>
5377
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
5478

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

76100
<ItemGroup>
77-
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.9.5" />
101+
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.10.4" />
78102
</ItemGroup>
79103

80104
<ItemGroup>

Daikoz.SQLWrapper/ErrorMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal class ErrorMessage
1313
public static readonly (string ErrorCode, string Message) MsgConfigurationSQLWrapperToolNotFound = ("SW00506", "sqlwrapper executable not found in: {0}");
1414
public static readonly (string ErrorCode, string Message) MsgSQLWrapperExecution = ("SW00507", "Error during execution of sqlwrapper: {0}");
1515
public static readonly (string ErrorCode, string Message) MsgSQLWrapperHelperOutputFilePathNotDefined = ("SW00508", "Helper output filepath not defined");
16-
public static readonly (string ErrorCode, string Message) MsgConfigurationDatabaseSectionNotDefined = ("SW00509", "No database defined");
16+
public static readonly (string ErrorCode, string Message) MsgConfigurationDatabaseSectionNotDefined = ("SW00509", "No schema database defined");
1717
public static readonly (string ErrorCode, string Message) MsgConfigurationDatabaseNotFound = ("SW00510", "Database name is not found: {0}");
1818
public static readonly (string ErrorCode, string Message) MsgConfigurationHelperXSLTNotFound = ("SW00511", "XSLT helper file not found: {0}");
1919
public static readonly (string ErrorCode, string Message) MsgSQLWrapperDirectoryNotFound = ("SW00512", "Path to search SQL files not found: {0}");

Daikoz.SQLWrapper/Resource.Designer.cs

Lines changed: 5 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Daikoz.SQLWrapper/Resource.resx

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -120,30 +120,37 @@
120120
<data name="DefaultConfiguration" xml:space="preserve">
121121
<value>{
122122
"Verbose": false,
123-
"Database": [
123+
"Schema": [
124124
{
125125
"Name": "Name of this database. Should be contain only characters: a-z A-Z 0-9 _ -",
126126
"ConnectionString": ".NET connection string to connect to database. If empty, use FilePath to get cached database previously generated.",
127-
"FilePath": "File path of cached database. If empty, store it in obj of project"
127+
"FilePath": "File path of cached database schema. If empty, store it in obj of project",
128+
"CustomType": [
129+
"SQLTable.SQLType=LanguageType",
130+
"SQLColumnName=LanguageType",
131+
"@SQLVariable=LanguageType"
132+
]
128133
}
129134
],
130-
"Helper": [
131-
{
132-
"Database": "Name of database defined in Database section",
133-
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
134-
"XLST": "Provide your own XLST to generate a helper. If empty, use default XLST provided by SQLWrapper",
135-
"OutputFilePath": "File path of helper"
136-
}
137-
],
138-
"Wrapper": [
139-
{
140-
"Database": "Name of database defined in Database section",
141-
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
142-
"XLST": "Provide your own XLST to generate the wrapper. If empty, use default XLST provided by SQLWrapper",
143-
"Path": "Absolute or relative path where to search sql file pattern. If empty, use path of project",
144-
"FilePattern": "SQL file to wrap. If empty, use \"*.sql\""
145-
}
146-
]
135+
"Wrapper": {
136+
"Database": [
137+
{
138+
"Schema": "Name of database schema defined in Schema section",
139+
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
140+
"XLST": "Provide your own XLST to generate a helper. If empty, use default XLST provided by SQLWrapper",
141+
"OutputFilePath": "File path of schema"
142+
}
143+
],
144+
"SQL": [
145+
{
146+
"Schema": "Name of database defined in Schema section",
147+
"Namespace": "Namespace in generated source. If empty, take the default namespace of project",
148+
"XLST": "Provide your own XLST to generate the wrapper. If empty, use default XLST provided by SQLWrapper",
149+
"Path": "Absolute or relative path where to search sql file pattern. If empty, use path of project",
150+
"FilePattern": "SQL file to wrap. If empty, use \"*.sql\""
151+
}
152+
]
153+
}
147154
}</value>
148155
</data>
149156
</root>

Daikoz.SQLWrapper/SQLWrapperConfig.cs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Daikoz.SQLWrapper
55
{
66
[DataContract]
7-
internal class Database
7+
internal class Schema
88
{
99
[DataMember]
1010
public string? Name { get; set; }
@@ -20,10 +20,10 @@ internal class Database
2020
}
2121

2222
[DataContract]
23-
internal class Helper
23+
internal class Database
2424
{
2525
[DataMember]
26-
public string? Database { get; set; }
26+
public string? Schema { get; set; }
2727

2828
[DataMember]
2929
public string? Namespace { get; set; }
@@ -36,10 +36,10 @@ internal class Helper
3636
}
3737

3838
[DataContract]
39-
internal class Wrapper
39+
internal class SQL
4040
{
4141
[DataMember]
42-
public string? Database { get; set; }
42+
public string? Schema { get; set; }
4343

4444
[DataMember]
4545
public string? Namespace { get; set; }
@@ -56,19 +56,26 @@ internal class Wrapper
5656
}
5757

5858
[DataContract]
59-
internal class SQLWrapperConfig
59+
internal class Wrapper
6060
{
6161
[DataMember]
62-
public bool Verbose { get; set; } = false;
62+
public List<Database>? Database { get; set; }
6363

6464
[DataMember]
65-
public List<Database>? Database { get; set; }
65+
public List<SQL>? SQL { get; set; }
66+
}
67+
68+
[DataContract]
69+
internal class SQLWrapperConfig
70+
{
71+
[DataMember]
72+
public bool Verbose { get; set; } = false;
6673

6774
[DataMember]
68-
public List<Helper>? Helper { get; set; }
75+
public List<Schema>? Schema { get; set; }
6976

7077
[DataMember]
71-
public List<Wrapper>? Wrapper { get; set; }
78+
public Wrapper? Wrapper { get; set; }
7279

7380
}
7481
}

0 commit comments

Comments
 (0)