Skip to content

Commit 18b5246

Browse files
feat: PoolingSessionSource 2.0 based on Npgsql pooling algorithm
1 parent 30a4fa2 commit 18b5246

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Ydb.Sdk/src/Ado/Internal/SqlParser.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ StringBuilder yql
232232
return startToken; // rollback parse IN LIST
233233
}
234234

235-
yql.Append(listStartToken > startToken ? sql[startToken .. listStartToken] : ' ');
235+
yql.Append(listStartToken > startToken ? sql[startToken..listStartToken] : ' ');
236236
var paramListName = sqlParamsBuilder.AddListPrimitiveParams(findNameParams);
237237
yql.Append(paramListName);
238238

@@ -273,7 +273,7 @@ private static (string Name, int NextToken) ParseNameParam(string sql, int curTo
273273
throw new YdbException($"Have empty name parameter, invalid SQL [position: {prevToken}]");
274274
}
275275

276-
return ($"${sql[prevToken .. curToken]}", curToken);
276+
return ($"${sql[prevToken..curToken]}", curToken);
277277
}
278278

279279
private static bool IsSqlIdentifierChar(this char c) => char.IsLetterOrDigit(c) || c == '_';

src/Ydb.Sdk/src/Ado/Session/PoolingSession.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// This file contains session pooling algorithms adapted from Npgsql
2+
// Original source: https://github.com/npgsql/npgsql
3+
// Copyright (c) 2002-2025, Npgsql
4+
// Licence https://github.com/npgsql/npgsql?tab=PostgreSQL-1-ov-file
5+
16
using Microsoft.Extensions.Logging;
27
using Ydb.Query;
38
using Ydb.Query.V1;

0 commit comments

Comments
 (0)