Skip to content

Commit 8f99350

Browse files
committed
Synchronized edmx with RunningConnectionTable connection management.
1 parent ecf561b commit 8f99350

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1012
-676
lines changed

BlackbirdDsl/BlackbirdDsl.rc

0 Bytes
Binary file not shown.

BlackbirdDsl/BlackbirdDsl.rc2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
1414
//
1515

1616
VS_VERSION_INFO VERSIONINFO
17-
FILEVERSION 10,1,2,1
18-
PRODUCTVERSION 10,1,2,1
17+
FILEVERSION 10,1,2,2
18+
PRODUCTVERSION 10,1,2,2
1919
FILEFLAGSMASK 0x3fL
2020
#ifdef _DEBUG
2121
FILEFLAGS 0x1L
@@ -32,12 +32,12 @@ BLOCK "1c0904b0"
3232
BEGIN
3333
VALUE "CompanyName", "BlackbirdSql"
3434
VALUE "FileDescription", "Blackbird Dsl Parser"
35-
VALUE "FileVersion", "10.1.2.1"
35+
VALUE "FileVersion", "10.1.2.2"
3636
VALUE "InternalName", "BlackbirdDsl.dll"
3737
VALUE "LegalCopyright", "Copyright (C) 2023"
3838
VALUE "OriginalFilename", "BlackbirdDsl.dll"
3939
VALUE "ProductName", "BlackbirdDsl"
40-
VALUE "ProductVersion", "10.1.2.1"
40+
VALUE "ProductVersion", "10.1.2.2"
4141
END
4242
END
4343
BLOCK "VarFileInfo"

BlackbirdDsl/Include/AssemblyInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#define Assembly_Copyright L"Copyright © BlackbirdSql 2023"
44
#define Assembly_Description L"BlackbirdSql DSL Parser"
5-
#define File_Version 10,1,2,1
6-
#define File_Version_Str "10.1.2.1"
5+
#define File_Version 10,1,2,2
6+
#define File_Version_Str "10.1.2.2"
77

88
//CLR assembly version
9-
#define Assembly_Version L"10.1.2.1"
9+
#define Assembly_Version L"10.1.2.2"
1010

BlackbirdSql.Common/Controls/ResultsPane/StatisticsPropertySet.cs

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,17 @@ public enum EnStatisticSpecialAction
2323

2424

2525

26-
public struct StatisticEntity
26+
public struct StatisticEntity(string name, EnStatisticSpecialAction specialAction, bool calculateAverage = true)
2727
{
28-
public static ResourceManager ResMgr => AttributeResources.ResourceManager;
29-
30-
public string Name;
28+
public string Name = name;
29+
public EnStatisticSpecialAction SpecialAction = specialAction;
30+
public bool CalculateAverage = calculateAverage;
3131

32-
public readonly string DisplayName => ResMgr.GetString("StatisticsPanelStat" + Name);
3332

34-
public EnStatisticSpecialAction SpecialAction;
33+
public static ResourceManager ResMgr => AttributeResources.ResourceManager;
3534

36-
public bool CalculateAverage;
35+
public readonly string DisplayName => ResMgr.GetString("StatisticsPanelStat" + Name);
3736

38-
public StatisticEntity(string name, EnStatisticSpecialAction specialAction, bool calculateAverage = true)
39-
{
40-
Name = name;
41-
SpecialAction = specialAction;
42-
CalculateAverage = calculateAverage;
43-
}
4437
}
4538

4639

@@ -52,27 +45,27 @@ public StatisticEntity(string name, EnStatisticSpecialAction specialAction, bool
5245
/// <summary>
5346
/// Array of statistics categories
5447
/// </summary>
55-
public static readonly string[] SCategoryNames = new string[5]
56-
{
48+
public static readonly string[] SCategoryNames =
49+
[
5750
AttributeResources.StatisticsPanelCategorySnapshotTimestamp,
5851
AttributeResources.StatisticsPanelCategoryQueryProfileStats,
5952
AttributeResources.StatisticsPanelCategoryNetworkStats,
6053
AttributeResources.StatisticsPanelCategoryTimeStats,
6154
AttributeResources.StatisticsPanelCategoryServerStats
62-
};
55+
];
6356

6457

6558
/// <summary>
6659
/// Delegates for generating Statistic category values.
6760
/// </summary>
68-
public static readonly GetCategoryValueDelegate[] SCategoryValueDelegates = new GetCategoryValueDelegate[5]
69-
{
61+
public static readonly GetCategoryValueDelegate[] SCategoryValueDelegates =
62+
[
7063
new GetCategoryValueDelegate(GetTimeOfExecution),
7164
null,
7265
null,
7366
null,
7467
null,
75-
};
68+
];
7669

7770

7871
/// <summary>
@@ -84,54 +77,52 @@ public StatisticEntity(string name, EnStatisticSpecialAction specialAction, bool
8477
/// 3. Including it in the StatisticsConnection.Load() method, and
8578
/// 4. Including it in StatisticsControl.RetrieveStatisticsIfNeeded()
8679
/// </summary>
87-
public static readonly StatisticEntity[][] SStatisticEntities = new StatisticEntity[5][]
88-
{
80+
public static readonly StatisticEntity[][] SStatisticEntities =
81+
[
8982
// ClientExecutionTime
9083
new StatisticEntity[0],
9184

9285
// QueryProfileStatistics
93-
new StatisticEntity[6]
94-
{
86+
[
9587
new StatisticEntity("IduRowCount", EnStatisticSpecialAction.SIFormat),
9688
new StatisticEntity("InsRowCount", EnStatisticSpecialAction.SIFormat),
9789
new StatisticEntity("UpdRowCount", EnStatisticSpecialAction.SIFormat),
9890
new StatisticEntity("DelRowCount", EnStatisticSpecialAction.SIFormat),
9991
new StatisticEntity("SelectRowCount", EnStatisticSpecialAction.SIFormat),
10092
new StatisticEntity("Transactions", EnStatisticSpecialAction.SIFormat)
101-
},
93+
],
10294

10395
// NetworkStatistics
104-
new StatisticEntity[8]
105-
{
96+
[
10697
new StatisticEntity("ServerRoundtrips", EnStatisticSpecialAction.SIFormat),
10798
new StatisticEntity("BufferCount", EnStatisticSpecialAction.SIFormat, false),
10899
new StatisticEntity("ReadCount", EnStatisticSpecialAction.SIFormat),
109100
new StatisticEntity("WriteCount", EnStatisticSpecialAction.SIFormat),
101+
// new StatisticEntity("ReadIdxCount", EnStatisticSpecialAction.SIFormat),
102+
// new StatisticEntity("ReadSeqCount", EnStatisticSpecialAction.SIFormat),
110103
new StatisticEntity("PurgeCount", EnStatisticSpecialAction.SIFormat),
111104
new StatisticEntity("ExpungeCount", EnStatisticSpecialAction.SIFormat),
112105
new StatisticEntity("Marks", EnStatisticSpecialAction.SIFormat),
113106
new StatisticEntity("PacketSize", EnStatisticSpecialAction.ByteFormat, false)
114-
},
107+
],
115108

116109
// TimeStatistics
117-
new StatisticEntity[3]
118-
{
110+
[
119111
new StatisticEntity("ExecutionStartTimeEpoch", EnStatisticSpecialAction.DateTimeFormat, false),
120112
new StatisticEntity("ExecutionEndTimeEpoch", EnStatisticSpecialAction.DateTimeFormat, false),
121113
new StatisticEntity("ExecutionTimeTicks", EnStatisticSpecialAction.ElapsedTimeFormat),
122-
},
114+
],
123115

124116
// ServerStatistics
125-
new StatisticEntity[6]
126-
{
117+
[
127118
new StatisticEntity("AllocationPages", EnStatisticSpecialAction.SIFormat, false),
128119
new StatisticEntity("CurrentMemory", EnStatisticSpecialAction.ByteFormat),
129120
new StatisticEntity("MaxMemory", EnStatisticSpecialAction.ByteFormat),
130121
new StatisticEntity("DatabaseSizeInPages", EnStatisticSpecialAction.SIFormat, false),
131122
new StatisticEntity("PageSize", EnStatisticSpecialAction.ByteFormat, false),
132123
new StatisticEntity("ActiveUserCount", EnStatisticSpecialAction.SIFormat)
133-
}
134-
};
124+
]
125+
];
135126

136127

137128

BlackbirdSql.Common/Controls/ResultsPane/StatisticsSnapshotAgent.cs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
namespace BlackbirdSql.Common.Controls.ResultsPane;
1212

13-
public class StatisticsSnapshotAgent
13+
public class StatisticsSnapshotAgent(FbConnection connection, StatisticsSnapshotAgent statisticsSnapShotBase = null)
1414
{
15-
private readonly FbConnection _InternalConnection;
16-
private readonly StatisticsSnapshotAgent _StatisticsSnapShotBase = null;
15+
private readonly FbConnection _InternalConnection = connection;
16+
private readonly StatisticsSnapshotAgent _StatisticsSnapShotBase = statisticsSnapShotBase;
1717

1818

1919
// QueryProfileStatistics
@@ -92,27 +92,20 @@ public class StatisticsSnapshotAgent
9292
public List<string> ActiveUsers => _ActiveUsers;
9393
public long ActiveUserCount => _ActiveUsers == null ? 0L : _ActiveUsers.Count;
9494

95-
96-
97-
public StatisticsSnapshotAgent(FbConnection connection, StatisticsSnapshotAgent statisticsSnapShotBase = null)
98-
{
99-
_InternalConnection = connection;
100-
_StatisticsSnapShotBase = statisticsSnapShotBase;
101-
}
102-
10395
public void Load(QueryManager qryMgr, long rowCount, long recordsAffected, DateTime executionEndTime)
10496
{
97+
_SelectRowCount = rowCount;
98+
_IduRowCount = recordsAffected;
99+
100+
105101

106102
try
107103
{
108104
FbDatabaseInfo info = new(_InternalConnection);
109105

110-
// QueryProfileStatistics
111-
_IduRowCount = recordsAffected;
112106
_InsRowCount = info.GetInsertCount();
113107
_UpdRowCount = info.GetUpdateCount();
114108
_DelRowCount = info.GetDeleteCount();
115-
_SelectRowCount = rowCount;
116109
_Transactions = info.GetActiveTransactionsCount();
117110

118111
// NetworkStatistics
@@ -121,10 +114,10 @@ public void Load(QueryManager qryMgr, long rowCount, long recordsAffected, DateT
121114
_ReadCount = info.GetReads() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadCount : 0);
122115
_WriteCount = info.GetWrites() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._WriteCount : 0);
123116

124-
// _ReadIdxCount = info.GetReadIdxCount() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadIdxCount : 0);
125-
// _ReadSeqCount = info.GetReadSeqCount() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadSeqCount : 0);
126-
_ReadIdxCount = 0 - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadIdxCount : 0);
127-
_ReadSeqCount = 0 - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadSeqCount : 0);
117+
_ReadIdxCount = info.GetReadIdxCount() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadIdxCount : 0);
118+
_ReadSeqCount = info.GetReadSeqCount() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadSeqCount : 0);
119+
// _ReadIdxCount = 0 - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadIdxCount : 0);
120+
// _ReadSeqCount = 0 - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ReadSeqCount : 0);
128121

129122
_PurgeCount = info.GetPurgeCount() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._PurgeCount : 0);
130123
_ExpungeCount = info.GetExpungeCount() - (_StatisticsSnapShotBase != null ? _StatisticsSnapShotBase._ExpungeCount : 0);

BlackbirdSql.Common/Ctl/DesignerExplorerServices.cs

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,23 +317,52 @@ public void ViewCode(IVsDataExplorerNode node, EnModelTargetType targetType)
317317
// Currently our only entry point to AbstractDesignerServices whose warnings are suppressed.
318318
Diag.ThrowIfNotOnUIThread();
319319

320-
MonikerAgent moniker = new(node, targetType);
321-
322-
IList<string> identifierList = moniker.Identifier.ToArray();
323-
EnModelObjectType objectType = moniker.ObjectType;
324-
Guid clsidEditorFactory = new Guid(SystemData.DslEditorFactoryGuid);
320+
// Tracer.Trace(GetType(), "ViewCode()");
325321

322+
MonikerAgent moniker = null;
323+
IList<string> identifierList = null;
324+
EnModelObjectType objectType = EnModelObjectType.Unknown;
326325
Action<DatabaseLocation, bool> callback = null;
327326

328-
if ((objectType == EnModelObjectType.Table || objectType == EnModelObjectType.View)
329-
&& targetType == EnModelTargetType.QueryScript && PersistentSettings.EditorExecuteQueryOnOpen)
327+
Guid clsidEditorFactory = new Guid(SystemData.DslEditorFactoryGuid);
328+
329+
try
330330
{
331-
// Tracer.Trace(GetType(), "ViewCode()", "assigning OnSqlQueryLoaded.");
332-
callback = OnSqlQueryLoaded;
331+
moniker = new(node, targetType);
332+
}
333+
catch (Exception ex)
334+
{
335+
Diag.Dug(ex);
336+
throw;
333337
}
334338

335339

336-
OpenExplorerEditor(node, objectType, identifierList, targetType, clsidEditorFactory, callback, null);
340+
try
341+
{
342+
identifierList = moniker.Identifier.ToArray();
343+
objectType = moniker.ObjectType;
344+
345+
if ((objectType == EnModelObjectType.Table || objectType == EnModelObjectType.View)
346+
&& targetType == EnModelTargetType.QueryScript && PersistentSettings.EditorExecuteQueryOnOpen)
347+
{
348+
callback = OnSqlQueryLoaded;
349+
}
350+
}
351+
catch (Exception ex)
352+
{
353+
Diag.Dug(ex);
354+
throw;
355+
}
356+
357+
try
358+
{
359+
OpenExplorerEditor(node, objectType, identifierList, targetType, clsidEditorFactory, callback, null);
360+
}
361+
catch (Exception ex)
362+
{
363+
Diag.Dug(ex);
364+
throw;
365+
}
337366
}
338367

339368

BlackbirdSql.Common/Properties/AttributeResources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BlackbirdSql.Common/Properties/AttributeResources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
<value>Rows returned by SELECT statements</value>
402402
</data>
403403
<data name="StatisticsPanelStatServerRoundtrips" xml:space="preserve">
404-
<value>Number of server roundtrips</value>
404+
<value>Number of server fetches</value>
405405
</data>
406406
<data name="StatisticsPanelStatTransactions" xml:space="preserve">
407407
<value>Number of transactions </value>

BlackbirdSql.Core/BlackbirdSql.Core.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
<Compile Include="Ctl\Diagnostics\IBEnumerableDescribers.cs" />
5959
<Compile Include="Ctl\Interfaces\IBDataConnectionProperties.cs" />
6060
<Compile Include="Model\AbstractRunningConnectionTable.cs" />
61-
<Compile Include="Ctl\Interfaces\IBDataViewSupport.cs" />
6261
<Compile Include="Ctl\Interfaces\IBAutomationConverter.cs" />
6362
<Compile Include="Ctl\Extensions\Index.cs" />
6463
<Compile Include="Ctl\Extensions\Range.cs" />
@@ -222,7 +221,7 @@
222221
</ItemGroup>
223222

224223
<ItemGroup>
225-
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="10.0.0" />
224+
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="10.0.0" />
226225
<PackageReference Include="Microsoft.VisualStudio.Data" Version="17.5.33428.388" />
227226
</ItemGroup>
228227

BlackbirdSql.Core/Ctl/AbstractAsyncPackage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Management.Instrumentation;
34
using System.Threading;
45
using System.Threading.Tasks;
56
using BlackbirdSql.Core.Ctl.Interfaces;
@@ -137,6 +138,8 @@ public virtual IVsSolution VsSolution
137138

138139
public abstract bool InvariantResolved { get; }
139140

141+
public abstract Type SchemaFactoryType { get; }
142+
140143

141144
public Microsoft.VisualStudio.OLE.Interop.IServiceProvider OleServiceProvider
142145
{

0 commit comments

Comments
 (0)