Premiere commit - Omika

This commit is contained in:
2026-10-23 18:46:50 +02:00
commit 8ea76c1b24
2155 changed files with 984301 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
namespace Omika.HfSqlProbe;
internal static class ProbeSqlBuilder
{
/// <summary>
/// Builds INSERT ... RETURNING &lt;idColumn&gt;.
/// Defensively validates all identifiers before interpolation.
/// </summary>
public static string BuildInsertReturning(string table, string idColumn, string markerColumn)
{
SqlIdentifierValidator.Validate(table);
SqlIdentifierValidator.Validate(idColumn);
SqlIdentifierValidator.Validate(markerColumn);
return $"INSERT INTO {table} ({markerColumn}) VALUES (?) RETURNING {idColumn}";
}
/// <summary>Count rows matching a marker value.</summary>
public static string BuildCountByMarker(string table, string markerColumn)
{
SqlIdentifierValidator.Validate(table);
SqlIdentifierValidator.Validate(markerColumn);
return $"SELECT COUNT(*) FROM {table} WHERE {markerColumn} = ?";
}
/// <summary>Insert a marker row (no RETURNING).</summary>
public static string BuildInsertMarker(string table, string markerColumn)
{
SqlIdentifierValidator.Validate(table);
SqlIdentifierValidator.Validate(markerColumn);
return $"INSERT INTO {table} ({markerColumn}) VALUES (?)";
}
/// <summary>Read GUID samples.</summary>
public static string BuildSelectGuids(int limit)
{
return "SELECT GUID FROM Client WHERE GUID IS NOT NULL AND GUID <> '' " +
$"LIMIT {limit}";
}
}