internal static CommandBase FromCode(SyntaxElement rootElement) { var entityKinds = rootElement .GetDescendants <SyntaxElement>(s => s.Kind == SyntaxKind.TableKeyword || s.Kind == SyntaxKind.DatabaseKeyword) .Select(s => s.Kind); if (!entityKinds.Any()) { throw new DeltaException("Delete ingestionbatching policy requires to act on a table or database (cluster isn't supported)"); } var entityKind = entityKinds.First(); var entityType = entityKind == SyntaxKind.TableKeyword ? EntityType.Table : EntityType.Database; var entityName = rootElement.GetFirstDescendant <NameReference>(); return(new DeleteIngestionBatchingPolicyCommand(entityType, EntityName.FromCode(entityName.Name))); }
internal static CommandBase FromCode(SyntaxElement rootElement) { var entityName = rootElement.GetFirstDescendant <NameReference>(); return(new DeleteAutoDeletePolicyCommand(EntityName.FromCode(entityName.Name))); }