91 references to SqlFormat
Aspire.Dashboard (14)
Components\Dialogs\TextVisualizerDialog.razor.cs (2)
63new SelectViewModel<string> { Id = DashboardUIHelpers.SqlFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogSqlFormat)] }, 99EnabledOptions.Add(DashboardUIHelpers.SqlFormat);
Model\TextVisualizerFormatHelpers.cs (11)
29["db.query.text"] = (DashboardUIHelpers.SqlFormat, true), 30["db.statement"] = (DashboardUIHelpers.SqlFormat, true) 37["commandText"] = (DashboardUIHelpers.SqlFormat, true), 38["queryText"] = (DashboardUIHelpers.SqlFormat, true), 39["sql"] = (DashboardUIHelpers.SqlFormat, false), 40["sqlQuery"] = (DashboardUIHelpers.SqlFormat, false), 41["sqlStatement"] = (DashboardUIHelpers.SqlFormat, false), 42["sql.query"] = (DashboardUIHelpers.SqlFormat, false), 43["sql.statement"] = (DashboardUIHelpers.SqlFormat, false) 59}.ToDictionary(static system => system, static _ => DashboardUIHelpers.SqlFormat, StringComparer.Ordinal); 81? DashboardUIHelpers.SqlFormat
Model\TextVisualizerViewModel.cs (1)
311else if (newFormat is DashboardUIHelpers.MarkdownFormat or DashboardUIHelpers.SqlFormat)
Aspire.Dashboard.Components.Tests (40)
Controls\StructuredLogDetailsTests.cs (17)
23[InlineData("commandText", "mssql", "Microsoft.EntityFrameworkCore.Database.Command", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 24[InlineData("db.query.text", "postgresql", "Npgsql.Command", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 25[InlineData("db.statement", "mysql", "MySqlConnector.MySqlCommand", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 26[InlineData("commandText", "mssql", "NHibernate.SQL", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 27[InlineData("db.statement", "sqlite", "Microsoft.EntityFrameworkCore.Database.Command", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 28[InlineData("db.query.text", "redis", "Microsoft.EntityFrameworkCore.Database.Command", null, DashboardUIHelpers.SqlFormat)] 29[InlineData("commandText", "mssql", "MyApp.Controllers.CommandsController", DashboardUIHelpers.SqlFormat, null)] 30[InlineData("sql", "postgresql", "MyApp.Services.QueryService", DashboardUIHelpers.SqlFormat, null)] 31[InlineData("commandText", "mssql", "Microsoft.EntityFrameworkCore.Query", DashboardUIHelpers.SqlFormat, null)] 32[InlineData("db.query.text", "postgresql", "MyApp.Services.QueryService", DashboardUIHelpers.SqlFormat, null)] 36[InlineData("commandText", null, "Npgsql.Command", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)]
Controls\TextVisualizerDialogTests.cs (23)
229Assert.Equal([DashboardUIHelpers.MarkdownFormat, DashboardUIHelpers.PlaintextFormat, DashboardUIHelpers.SqlFormat], instance.EnabledOptions.ToImmutableSortedSet()); 370await dialogService.ShowDialogAsync<TextVisualizerDialog>(new TextVisualizerDialogViewModel(rawText, string.Empty, ContainsSecret: false, FixedFormat: DashboardUIHelpers.JsonFormat, InitialFormat: DashboardUIHelpers.SqlFormat), new DialogParameters()); 428[InlineData(DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 442var sqlOption = options.Single(o => o.Id == DashboardUIHelpers.SqlFormat); 451Assert.Equal(DashboardUIHelpers.SqlFormat, dialog.Instance.TextVisualizerViewModel.FormatKind); 452Assert.Equal(DashboardUIHelpers.SqlFormat, select.Instance.Value?.Id); 464[InlineData("""{"query":"SELECT 1"}""", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 465[InlineData("<query>SELECT 1</query>", DashboardUIHelpers.SqlFormat, DashboardUIHelpers.SqlFormat)] 483Assert.Equal(initialFormat is null, select.Instance.OptionDisabled!(options.Single(o => o.Id == DashboardUIHelpers.SqlFormat))); 502.Add(p => p.TextVisualizerFormat, DashboardUIHelpers.SqlFormat)); 505Assert.Equal(DashboardUIHelpers.SqlFormat, getCut().FindComponent<TextVisualizerDialog>().Instance.TextVisualizerViewModel.FormatKind); 513.Add(p => p.ViewModel, new TextVisualizerViewModel("SELECT '<script>'", indentText: true, knownFormat: DashboardUIHelpers.SqlFormat)) 524[InlineData("Microsoft.EntityFrameworkCore.Database.Command", DashboardUIHelpers.SqlFormat, false)] 525[InlineData("Microsoft.EntityFrameworkCore.Database.Command", DashboardUIHelpers.SqlFormat, true)] 526[InlineData("Npgsql.Command", DashboardUIHelpers.SqlFormat, false)] 527[InlineData("Npgsql.Command", DashboardUIHelpers.SqlFormat, true)] 528[InlineData("MySqlConnector.MySqlCommand", DashboardUIHelpers.SqlFormat, false)] 529[InlineData("MySqlConnector.MySqlCommand", DashboardUIHelpers.SqlFormat, true)] 530[InlineData("NHibernate.SQL", DashboardUIHelpers.SqlFormat, false)] 531[InlineData("NHibernate.SQL", DashboardUIHelpers.SqlFormat, true)]
Aspire.Dashboard.Tests (37)
Model\OtlpSpanAttributeItemTests.cs (3)
14[InlineData("postgresql", DashboardUIHelpers.SqlFormat)] 35[InlineData("", "postgresql", DashboardUIHelpers.SqlFormat)] 37[InlineData("postgresql", "redis", DashboardUIHelpers.SqlFormat)]
Model\SpanDetailsViewModelTests.cs (2)
17[InlineData("db.query.text", "db.system.name", "postgresql", DashboardUIHelpers.SqlFormat)] 18[InlineData("db.statement", "db.system", "mssql", DashboardUIHelpers.SqlFormat)]
Model\TextVisualizerFormatHelpersTests.cs (24)
29[InlineData("Microsoft.EntityFrameworkCore.Database.Command", DashboardUIHelpers.SqlFormat)] 30[InlineData("Microsoft.EntityFrameworkCore.Database.Command.Custom", DashboardUIHelpers.SqlFormat)] 34[InlineData("Npgsql.Command", DashboardUIHelpers.SqlFormat)] 35[InlineData("Npgsql.Command.Custom", DashboardUIHelpers.SqlFormat)] 36[InlineData("MySqlConnector.MySqlCommand", DashboardUIHelpers.SqlFormat)] 37[InlineData("MySqlConnector.MySqlCommand.Custom", DashboardUIHelpers.SqlFormat)] 38[InlineData("NHibernate.SQL", DashboardUIHelpers.SqlFormat)] 39[InlineData("NHibernate.SQL.Custom", DashboardUIHelpers.SqlFormat)] 69Assert.Equal(DashboardUIHelpers.SqlFormat, TextVisualizerFormatHelpers.GetLogFormat("commandText", source, [])); 89[InlineData("MyApp.Database", "db.query.text", "db.system.name", "postgresql", DashboardUIHelpers.SqlFormat)] 90[InlineData("MyApp.Database", "db.statement", "db.system", "mysql", DashboardUIHelpers.SqlFormat)] 91[InlineData("MyApp.Database", "commandText", "db.system.name", "mssql", DashboardUIHelpers.SqlFormat)] 92[InlineData("MyApp.Database", "queryText", "db.system", "postgresql", DashboardUIHelpers.SqlFormat)] 93[InlineData("NHibernate.SQL", "commandText", "db.system.name", "mssql", DashboardUIHelpers.SqlFormat)] 94[InlineData("", "db.query.text", "db.system.name", "sqlite", DashboardUIHelpers.SqlFormat)] 99[InlineData("MyApp.Database", "sql", "db.system.name", "redis", DashboardUIHelpers.SqlFormat)] 120[InlineData("postgresql", "redis", DashboardUIHelpers.SqlFormat)] 122[InlineData("", "postgresql", DashboardUIHelpers.SqlFormat)] 134[InlineData("commandText", "mssql", DashboardUIHelpers.SqlFormat)] 135[InlineData("db.statement", "mysql", DashboardUIHelpers.SqlFormat)] 136[InlineData("db.query.text", "postgresql", DashboardUIHelpers.SqlFormat)] 162Assert.Equal(DashboardUIHelpers.SqlFormat, TextVisualizerFormatHelpers.GetFormat(name, [])); 204Assert.Equal(isSql ? DashboardUIHelpers.SqlFormat : null, TextVisualizerFormatHelpers.GetFormat(name, [KeyValuePair.Create(systemKey, system)])); 218[InlineData("postgresql", DashboardUIHelpers.SqlFormat)]
Model\TextVisualizerViewModelTests.cs (8)
16var vm = new TextVisualizerViewModel(query, indentText: true, knownFormat: DashboardUIHelpers.SqlFormat); 18Assert.Equal(DashboardUIHelpers.SqlFormat, vm.FormatKind); 20Assert.All(vm.FormattedLines, line => Assert.Equal(DashboardUIHelpers.SqlFormat, line.FormatKind)); 26vm.UpdateFormat(DashboardUIHelpers.SqlFormat); 27Assert.Equal(DashboardUIHelpers.SqlFormat, vm.FormatKind); 36var vm = new TextVisualizerViewModel(text, indentText: true, knownFormat: DashboardUIHelpers.SqlFormat); 38Assert.Equal(DashboardUIHelpers.SqlFormat, vm.FormatKind); 40Assert.All(vm.FormattedLines, line => Assert.Equal(DashboardUIHelpers.SqlFormat, line.FormatKind));