Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark IExternalDataSource as mutable if applicable #2246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2879,6 +2879,10 @@ public override void Visit(FirstNameNode node)
{
_txb.SetMutable(node, true);
}
else if (lookupInfo.Data is IExternalDataSource ds)
{
_txb.SetMutable(node, ds.IsWritable);
}
}
else if (lookupInfo.Kind == BindKind.ScopeCollection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ internal interface IExternalDataSource : IExternalEntity, IExternalPageableSymbo
bool IsRefreshable { get; }

bool RequiresAsync { get; }

bool IsWritable { get; }

IExternalDataEntityMetadataProvider DataEntityMetadataProvider { get; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class AccountsEntity : IExternalEntity, IExternalDataSource

public bool IsPageable => true;

public bool IsWritable => true;

DType IExternalEntity.Type => AccountsTypeHelper.GetDType();

IExternalDataEntityMetadataProvider IExternalDataSource.DataEntityMetadataProvider => throw new NotImplementedException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ internal TestDataSource(string name, DType schema, string[] keyColumns = null, I

IDelegationMetadata IExternalDataSource.DelegationMetadata => DelegationMetadata;

public bool IsWritable => throw new NotImplementedException();

public bool CanIncludeExpand(IExpandInfo expandToAdd)
{
throw new NotImplementedException();
Expand Down