Skip to content

Commit

Permalink
Fix #91 (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
sachabruttin authored Nov 29, 2022
1 parent 61e56a2 commit 2323200
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CosmosDbExplorer/ViewModels/QueryEditorViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using CosmosDbExplorer.Contracts.Services;
Expand Down Expand Up @@ -75,7 +76,7 @@ public override void Load(string contentId, ContainerNodeViewModel node, CosmosC

_documentService = ActivatorUtilities.CreateInstance<CosmosDocumentService>(_serviceProvider, connection, database, container);

Content = $"SELECT * FROM {Container.Id} AS {Container.Id.Substring(0, 1).ToLower()}";
Content = $"SELECT * FROM {Regex.Replace(Container.Id, @"[^0-9a-zA-Z]+", "_")} AS {Container.Id[..1].ToLower()}";

//var split = Container.SelfLink.Split(new char[] { '/' });
ToolTip = $"{Connection.Label}/{database.Id}/{Container.Id}";
Expand Down

0 comments on commit 2323200

Please sign in to comment.