Open 784651 opened 1 year ago
Are you talking about comments within a function or comments "around" commands, for instance:
// This is my table .create table MyTable(Id:string)
delta-kusto retains comments that are on the same line as a kusto command, but removes '"comment only" lines. Example:
// this comment will be removed by delta-kusto
.create function with (docstring = "This description will be kept", folder = "Test") deltakustoCommentTest() {
// this comment line will also be removed
let T = datatable(col1:int)[1, 2];
T | count // this comment will be retained by delta-kusto
}
Yeah... that would be more difficult to implement, hence more long term.
But I can understand it to be useful.
We're experiencing slightly different, but similar behavior - we do "full backup" style delta-kusto commands on our databases to generate files that we then version control to retain a history of the changes to the full backup (database delta against an empty file). This method of creating a delta-kusto generated file does include the comment-only lines within function definitions. However, we've been using this file and delta-kusto to get a set of commands to run on the same database, but these commands are including "create-or-alter" commands for functions only because they have comment only lines. The fact that a regular backup includes the comments makes me think it should be feasible.
+1 the difference between the "full backup" (delta against empty current) and delta-generated functions (delta target against current repo definition) is a bit misleading. Preserving comments during the initial capture and then stripping them during subsequent updates via deltas can go unnoticed.
@vplauzon, is there any work planned to address this gap, and would it be isolated to just Delta-Kusto code or the Kusto parser as well?
The biggest issue we have now with Delta-Kusto is that comments are destroyed and not maintained. Any possibility to allow Comments to remain? I can see how getting delta's from comments might be tricky, but comments are important to keep.