chore: initial git load of code space

This commit is contained in:
Thom Lamb
2026-05-12 08:52:33 -05:00
parent 9abada692f
commit 5e467bcc9c
384 changed files with 65960 additions and 2 deletions
@@ -0,0 +1,72 @@
using System.Diagnostics;
using Strata.SqlTools.SqlBreakdown.Interfaces.Core;
namespace Strata.SqlTools.SqlBreakdown.Classes;
#pragma warning disable S1694 // An abstract class should have both abstract and concrete methods
public abstract class SelectSource : IVisitable
{
public abstract T Accept<T>(IVisitor<T> visitor);
}
[DebuggerDisplay("{TableName}")]
public class TableSource : SelectSource
{
public string TableName { get; }
public string? Schema { get; }
public string? Alias { get; }
public TableSource(string tableName) : this(tableName, null)
{
}
#pragma warning disable S3427 // Method overloads with default parameter values should not overlap
public TableSource(string tableName, string? schema = null, string? alias = null)
{
TableName = string.IsNullOrWhiteSpace(tableName) ? throw new ArgumentNullException(nameof(tableName)) : tableName;
Schema = string.IsNullOrWhiteSpace(schema) ? null : schema;
Alias = string.IsNullOrWhiteSpace(alias) ? null : alias;
}
#pragma warning restore S3427
public override T Accept<T>(IVisitor<T> visitor)
{
return visitor.VisitTableSource(this);
}
}
public class RegisteredTableSource : TableSource
{
public int TableId { get; }
public RegisteredTableSource(int tableId, string tableSchema, string tableName)
: this(tableId, tableSchema, tableName, null)
{
}
public RegisteredTableSource(int tableId, string tableSchema, string tableName, string? alias) : base(tableName, tableSchema, alias)
{
if (tableId <= 0)
{
throw new ArgumentException("tableId must be greater than 0", nameof(tableId));
}
if (string.IsNullOrWhiteSpace(tableSchema))
{
throw new ArgumentException("tableName cannot be null or whitespace", nameof(tableSchema));
}
if (string.IsNullOrWhiteSpace(tableName))
{
throw new ArgumentException("tableName cannot be null or whitespace", nameof(tableName));
}
TableId = tableId;
}
}
#pragma warning restore S1694