Skip to content

Commit

Permalink
fixes #2573 (partially)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed Oct 11, 2024
1 parent d8bdd71 commit f4a0e2d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,40 @@ private static RoutineModel GetTableValuedFunctions(string dacpacPath, ModuleMod
var i = 0;
foreach (var column in func.Columns)
{
string storeType = null;

if (column.ColumnType == ColumnType.ComputedColumn)
{
column.ExpressionDependencies.ToList().ForEach(e =>
{
if (e is TSqlColumnReference colRef)
{
storeType = colRef.DataType.First().Name.Parts[0];
}
});
}

if (column.ColumnType == ColumnType.Column)
{
if (column.DataType.First() is TSqlTableTypeReference)
{
storeType = "structured";
}
else
{
storeType = column.DataType.First().Name.Parts[0];
}
}

if (storeType == null)
{
errors.Add($"Could not determine store type for column {column.Name.Parts[2]} in function {key}");
continue;
}

columnList.Add(new ModuleResultElement
{
StoreType = column.DataType.First().Name.Parts[0],
StoreType = storeType,
Nullable = column.Nullable,
Name = column.Name.Parts[2],
Ordinal = i++,
Expand Down

0 comments on commit f4a0e2d

Please sign in to comment.