Skip to content

Commit 66957bc

Browse files
author
Thomas Mahlberg
committed
Added script validation
1 parent 9ba9606 commit 66957bc

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

KustoSchemaTools/Changes/DatabaseChanges.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ .. GenerateFollowerCachingChanges(oldState, newState, db => db.MaterializedViews
222222
}
223223
}
224224

225+
foreach(var script in result.SelectMany(itm => itm.Scripts))
226+
{
227+
var code = KustoCode.Parse(script.Text);
228+
var diagnostics = code.GetDiagnostics();
229+
script.IsValid = diagnostics.Any() == false;
230+
}
231+
225232
return result;
226233

227234
}

KustoSchemaTools/Parser/KustoWriter/DefaultDatabaseWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public async Task WriteAsync(Database sourceDb, Database targetDb, KustoClient c
2121
Console.WriteLine("---------------------------------------------------------------------------");
2222
}
2323

24-
foreach (var follower in targetDb.Followers)
24+
foreach (var follower in sourceDb.Followers)
2525
{
2626
var followerClient = new KustoClient(follower.Key);
2727
var source = FollowerLoader.LoadFollower(follower.Value.DatabaseName, followerClient);

0 commit comments

Comments
 (0)