This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 578ed5ea474 IGNITE-25290 .NET: Add StringSyntax attribute to SQL APIs 
(#7027)
578ed5ea474 is described below

commit 578ed5ea474192cf7051c1f3896d9061d47e46f7
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Thu Nov 20 16:16:54 2025 +0200

    IGNITE-25290 .NET: Add StringSyntax attribute to SQL APIs (#7027)
---
 modules/platforms/dotnet/Apache.Ignite/Sql/SqlStatement.cs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/platforms/dotnet/Apache.Ignite/Sql/SqlStatement.cs 
b/modules/platforms/dotnet/Apache.Ignite/Sql/SqlStatement.cs
index c844c428fac..b355e254e78 100644
--- a/modules/platforms/dotnet/Apache.Ignite/Sql/SqlStatement.cs
+++ b/modules/platforms/dotnet/Apache.Ignite/Sql/SqlStatement.cs
@@ -20,6 +20,7 @@ namespace Apache.Ignite.Sql
 {
     using System;
     using System.Collections.Generic;
+    using System.Diagnostics.CodeAnalysis;
     using Internal.Common;
     using NodaTime;
 
@@ -43,6 +44,8 @@ namespace Apache.Ignite.Sql
         /// </summary>
         public static readonly TimeSpan DefaultTimeout = TimeSpan.Zero;
 
+        private const string StringSyntaxSql = "Sql";
+
         /// <summary>
         /// Cached instance of empty properties.
         /// </summary>
@@ -74,6 +77,7 @@ namespace Apache.Ignite.Sql
         /// For more information, see <see 
href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/ZoneId.html#of(java.lang.String)"/>.
         /// </param>
         public SqlStatement(
+            [StringSyntax(StringSyntaxSql)]
             string query,
             TimeSpan? timeout = null,
             string? schema = null,
@@ -95,6 +99,7 @@ namespace Apache.Ignite.Sql
         /// <summary>
         /// Gets the query text.
         /// </summary>
+        [StringSyntax(StringSyntaxSql)]
         public string Query { get; init; }
 
         /// <summary>
@@ -141,14 +146,14 @@ namespace Apache.Ignite.Sql
         /// </summary>
         /// <param name="query">Query string.</param>
         /// <returns>Statement.</returns>
-        public static implicit operator SqlStatement(string query) => 
ToSqlStatement(query);
+        public static implicit operator 
SqlStatement([StringSyntax(StringSyntaxSql)] string query) => 
ToSqlStatement(query);
 
         /// <summary>
         /// Converts a query string to an instance of <see 
cref="SqlStatement"/>.
         /// </summary>
         /// <param name="query">Query string.</param>
         /// <returns>Statement.</returns>
-        public static SqlStatement ToSqlStatement(string query) => new(query);
+        public static SqlStatement 
ToSqlStatement([StringSyntax(StringSyntaxSql)] string query) => new(query);
 
         /// <inheritdoc />
         public override string ToString() =>

Reply via email to