Skip to content

Commit

Permalink
Merge pull request #16 from AlexisOlson/ToM-Patch
Browse files Browse the repository at this point in the history
(Fix) Add logic for escaping column names
  • Loading branch information
AlexisOlson authored Jun 10, 2024
2 parents 14143dc + a404030 commit 33a6c94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Functions/Table/ToM.pq
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ let
ColTypes_Text = Text.Combine(
List.Transform(
Table.ToRecords(Schema),
each [Name] & " = " & [Kind]
each
if (Text.Select([Name], {"0".."9", "a".."z", "A".."Z"} ) = [Name])
and List.Contains({"a".."z", "A".."Z"}, Text.Start([Name], 1))
then [Name] & " = " & [Kind]
else "#""" & [Name] & """ = " & [Kind]
),
", "
),
Expand Down Expand Up @@ -157,4 +161,3 @@ let
in
// Apply the function metadata to myFunction.
Value.ReplaceType(myFunction, metaDocumentation)

0 comments on commit 33a6c94

Please sign in to comment.