33
44namespace DbSyncKit . Templates . MySql
55{
6+ /// <summary>
7+ /// Implementation of <see cref="IQueryTemplates"/> for MySQL database, providing templates for various SQL queries.
8+ /// </summary>
69 public class QueryTemplates : IQueryTemplates
710 {
811 #region Public Properties
12+ /// <summary>
13+ /// Gets the template for a SELECT query.
14+ /// </summary>
915 public IFluidTemplate SELECT_QUERY => _selectQueryTemplate . Value ;
16+
17+ /// <summary>
18+ /// Gets the template for an INSERT query.
19+ /// </summary>
1020 public IFluidTemplate INSERT_QUERY => _insertQueryTemplate . Value ;
21+
22+ /// <summary>
23+ /// Gets the template for an UPDATE query.
24+ /// </summary>
1125 public IFluidTemplate UPDATE_QUERY => _updateQueryTemplate . Value ;
26+
27+ /// <summary>
28+ /// Gets the template for a DELETE query.
29+ /// </summary>
1230 public IFluidTemplate DELETE_QUERY => _deleteQueryTemplate . Value ;
31+
32+ /// <summary>
33+ /// Gets the template for a COMMENT query.
34+ /// </summary>
1335 public IFluidTemplate COMMENT_QUERY => _commentQueryTemplate . Value ;
1436
37+
1538 #endregion
1639
1740 #region Private Properties
@@ -25,14 +48,19 @@ public class QueryTemplates : IQueryTemplates
2548 #endregion
2649
2750 #region Templates
28-
51+ /// <summary>
52+ /// Creates a template for a SELECT query.
53+ /// </summary>
2954 private static IFluidTemplate CreateSelectQueryTemplate ( )
3055 {
3156 var str = @" SELECT {{ Columns | join: ', ' }} FROM {{ TableName }}; " ;
3257
3358 return parser . Parse ( str ) ;
3459 }
3560
61+ /// <summary>
62+ /// Creates a template for an INSERT query.
63+ /// </summary>
3664 private static IFluidTemplate CreateInsertQueryTemplate ( )
3765 {
3866 var str = @"
@@ -42,6 +70,9 @@ private static IFluidTemplate CreateInsertQueryTemplate()
4270 return parser . Parse ( str ) ;
4371 }
4472
73+ /// <summary>
74+ /// Creates a template for an UPDATE query.
75+ /// </summary>
4576 private static IFluidTemplate CreateUpdateQueryTemplate ( )
4677 {
4778 var str = @"
@@ -50,6 +81,9 @@ private static IFluidTemplate CreateUpdateQueryTemplate()
5081 return parser . Parse ( str ) ;
5182 }
5283
84+ /// <summary>
85+ /// Creates a template for a DELETE query.
86+ /// </summary>
5387 private static IFluidTemplate CreateDeleteQueryTemplate ( )
5488 {
5589 var str = @"
@@ -58,13 +92,16 @@ private static IFluidTemplate CreateDeleteQueryTemplate()
5892 return parser . Parse ( str ) ;
5993 }
6094
95+ /// <summary>
96+ /// Creates a template for a COMMENT query.
97+ /// </summary>
6198 private static IFluidTemplate CreateCommentQueryTemplate ( )
6299 {
63- var str = @"{% unless isMultiLine %} -- {{ comment }} {% else %}
100+ var str = @"{% unless isMultiLine %} -- {{ Comment }} {% else %}
64101/*
65- {{ comment }}
102+ {{ Comment }}
66103*/
67- -- {{ comment }} {% endunless %}";
104+ {% endunless %}" ;
68105
69106 return parser . Parse ( str ) ;
70107 }
0 commit comments