Skip to content

Commit

Permalink
Merge pull request #87 from github/caol-ila-patch-1
Browse files Browse the repository at this point in the history
Validate changes for deletions
  • Loading branch information
caol-ila authored Oct 23, 2024
2 parents 7684697 + 5994293 commit 5853c0f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion KustoSchemaTools/Changes/DeletionChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ public DeletionChange(string entity, string entityType)

public string Entity { get; set; }

public List<DatabaseScriptContainer> Scripts => new List<DatabaseScriptContainer> { new DatabaseScriptContainer("Deletion", 0, $".drop {EntityType} {Entity}") };
public List<DatabaseScriptContainer> Scripts
{
get
{
var sc = new DatabaseScriptContainer("Deletion", 0, $".drop {EntityType} {Entity}");
var code = KustoCode.Parse(sc.Text);
var diagnostics = code.GetDiagnostics();
sc.IsValid = diagnostics.Any() == false;
return new List<DatabaseScriptContainer> { sc };
}
}

public string Markdown
{
Expand Down

0 comments on commit 5853c0f

Please sign in to comment.