Skip to content

Commit c4085be

Browse files
committed
Refactor: move structures for specific network types out of dbstructures, into their own dbstructures.xxx.pas, and include const.inc in project sources
1 parent 67cd7bb commit c4085be

18 files changed

Lines changed: 4800 additions & 4715 deletions

packages/Delphi10.4/heidisql.dpr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ uses
1919
apphelpers in '..\..\source\apphelpers.pas',
2020
sqlhelp in '..\..\source\sqlhelp.pas' {frmSQLhelp},
2121
dbstructures in '..\..\source\dbstructures.pas',
22+
dbstructures.mysql in '..\..\source\dbstructures.mysql.pas',
23+
dbstructures.mssql in '..\..\source\dbstructures.mssql.pas',
24+
dbstructures.postgresql in '..\..\source\dbstructures.postgresql.pas',
25+
dbstructures.sqlite in '..\..\source\dbstructures.sqlite.pas',
26+
dbstructures.interbase in '..\..\source\dbstructures.interbase.pas',
2227
column_selection in '..\..\source\column_selection.pas' {frmColumnSelection},
2328
data_sorting in '..\..\source\data_sorting.pas' {frmDataSorting},
2429
createdatabase in '..\..\source\createdatabase.pas' {CreateDatabaseForm},

packages/Delphi10.4/heidisql.dproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@
169169
<Form>frmSQLhelp</Form>
170170
</DCCReference>
171171
<DCCReference Include="..\..\source\dbstructures.pas"/>
172+
<DCCReference Include="..\..\source\dbstructures.mysql.pas"/>
173+
<DCCReference Include="..\..\source\dbstructures.mssql.pas"/>
174+
<DCCReference Include="..\..\source\dbstructures.postgresql.pas"/>
175+
<DCCReference Include="..\..\source\dbstructures.sqlite.pas"/>
176+
<DCCReference Include="..\..\source\dbstructures.interbase.pas"/>
172177
<DCCReference Include="..\..\source\column_selection.pas">
173178
<Form>frmColumnSelection</Form>
174179
</DCCReference>
@@ -236,9 +241,9 @@
236241
</DCCReference>
237242
<DCCReference Include="..\..\source\csv_detector.pas">
238243
<Form>frmCsvDetector</Form>
239-
<FormType>dfm</FormType>
240244
</DCCReference>
241245
<DCCReference Include="..\..\source\generic_types.pas"/>
246+
<None Include="..\..\source\const.inc"/>
242247
<BuildConfiguration Include="Debug">
243248
<Key>Cfg_2</Key>
244249
<CfgParent>Base</CfgParent>

source/apphelpers.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface
1212
Classes, SysUtils, Graphics, GraphUtil, ClipBrd, Dialogs, Forms, Controls, ShellApi,
1313
Windows, ShlObj, ActiveX, VirtualTrees, SynRegExpr, Messages, Math,
1414
Registry, DateUtils, Generics.Collections, StrUtils, AnsiStrings, TlHelp32, Types,
15-
dbconnection, dbstructures, SynMemo, Menus, WinInet, gnugettext, Themes,
15+
dbconnection, dbstructures, dbstructures.mysql, SynMemo, Menus, WinInet, gnugettext, Themes,
1616
Character, ImgList, System.UITypes, ActnList, WinSock, IOUtils, StdCtrls, ComCtrls,
1717
CommCtrl, Winapi.KnownFolders, SynUnicode;
1818

source/copytable.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interface
55

66
uses
77
Windows, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, extra_controls,
8-
dbconnection, dbstructures, VirtualTrees, SynEdit, SynMemo, Menus, gnugettext;
8+
dbconnection, dbstructures, dbstructures.mysql, VirtualTrees, SynEdit, SynMemo, Menus, gnugettext;
99

1010
type
1111
TCopyTableForm = class(TExtForm)

source/dbconnection.pas

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
interface
44

55
uses
6-
Classes, SysUtils, windows, dbstructures, SynRegExpr, Generics.Collections, Generics.Defaults,
6+
Classes, SysUtils, Windows, Generics.Collections, Generics.Defaults,
77
DateUtils, Types, Math, Dialogs, ADODB, DB, DBCommon, ComObj, Graphics, ExtCtrls, StrUtils,
8-
gnugettext, AnsiStrings, Controls, Forms, System.IOUtils, generic_types, System.IniFiles,
8+
AnsiStrings, Controls, Forms, System.IOUtils, System.IniFiles,
9+
SynRegExpr, gnugettext, generic_types,
10+
dbstructures, dbstructures.mysql, dbstructures.mssql, dbstructures.postgresql, dbstructures.sqlite, dbstructures.interbase,
911
FireDAC.Stan.Intf, FireDAC.Stan.Option,
1012
FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
1113
FireDAC.Phys, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys.IB,

source/dbstructures.interbase.pas

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
unit dbstructures.interbase;
2+
3+
4+
interface
5+
6+
uses
7+
dbstructures;
8+
9+
var
10+
11+
// Interbase field types
12+
// Taken from https://docwiki.embarcadero.com/InterBase/2020/en/RDB$FIELDS
13+
InterbaseDatatypes: Array[0..13] of TDBDatatype =
14+
(
15+
(
16+
Index: dbdtUnknown;
17+
Name: 'UNKNOWN';
18+
Description: 'Unknown data type';
19+
HasLength: False;
20+
RequiresLength: False;
21+
HasBinary: False;
22+
HasDefault: False;
23+
LoadPart: False;
24+
Category: dtcOther;
25+
),
26+
(
27+
Index: dbdtBlob;
28+
NativeTypes: '261';
29+
Name: 'BLOB';
30+
HasLength: False;
31+
RequiresLength: False;
32+
HasBinary: False;
33+
HasDefault: False;
34+
LoadPart: True;
35+
Category: dtcBinary;
36+
),
37+
(
38+
Index: dbdtBool;
39+
NativeTypes: '17';
40+
Name: 'BOOLEAN';
41+
HasLength: False;
42+
RequiresLength: False;
43+
HasBinary: False;
44+
HasDefault: False;
45+
LoadPart: False;
46+
Category: dtcOther;
47+
),
48+
(
49+
Index: dbdtChar;
50+
NativeTypes: '14';
51+
Name: 'CHAR';
52+
HasLength: False;
53+
RequiresLength: False;
54+
HasBinary: False;
55+
HasDefault: False;
56+
LoadPart: False;
57+
Category: dtcText;
58+
),
59+
(
60+
Index: dbdtVarchar;
61+
NativeTypes: '37|40';
62+
Name: 'VARCHAR';
63+
HasLength: True;
64+
RequiresLength: False;
65+
HasBinary: False;
66+
HasDefault: False;
67+
LoadPart: True;
68+
Category: dtcText;
69+
),
70+
(
71+
Index: dbdtFloat;
72+
NativeTypes: '10|11';
73+
Name: 'FLOAT';
74+
HasLength: False;
75+
RequiresLength: False;
76+
HasBinary: False;
77+
HasDefault: False;
78+
LoadPart: False;
79+
Category: dtcReal;
80+
),
81+
(
82+
Index: dbdtDouble;
83+
NativeTypes: '27';
84+
Name: 'DOUBLE PRECISION';
85+
HasLength: False;
86+
RequiresLength: False;
87+
HasBinary: False;
88+
HasDefault: False;
89+
LoadPart: False;
90+
Category: dtcReal;
91+
),
92+
(
93+
Index: dbdtBigint;
94+
NativeTypes: '16';
95+
Name: 'INT64';
96+
HasLength: False;
97+
RequiresLength: False;
98+
HasBinary: False;
99+
HasDefault: False;
100+
LoadPart: False;
101+
Category: dtcInteger;
102+
),
103+
(
104+
Index: dbdtInt;
105+
NativeTypes: '8';
106+
Name: 'INTEGER';
107+
HasLength: False;
108+
RequiresLength: False;
109+
HasBinary: False;
110+
HasDefault: False;
111+
LoadPart: False;
112+
Category: dtcInteger;
113+
),
114+
(
115+
Index: dbdtNumeric;
116+
NativeTypes: '9';
117+
Name: 'QUAD';
118+
HasLength: False;
119+
RequiresLength: False;
120+
HasBinary: False;
121+
HasDefault: False;
122+
LoadPart: False;
123+
Category: dtcInteger;
124+
),
125+
(
126+
Index: dbdtSmallint;
127+
NativeTypes: '7';
128+
Name: 'SMALLINT';
129+
HasLength: False;
130+
RequiresLength: False;
131+
HasBinary: False;
132+
HasDefault: False;
133+
LoadPart: False;
134+
Category: dtcInteger;
135+
),
136+
(
137+
Index: dbdtDate;
138+
NativeTypes: '12';
139+
Name: 'DATE';
140+
HasLength: False;
141+
RequiresLength: False;
142+
HasBinary: False;
143+
HasDefault: False;
144+
LoadPart: False;
145+
Category: dtcTemporal;
146+
),
147+
(
148+
Index: dbdtTime;
149+
NativeTypes: '13';
150+
Name: 'TIME';
151+
HasLength: False;
152+
RequiresLength: False;
153+
HasBinary: False;
154+
HasDefault: False;
155+
LoadPart: False;
156+
Category: dtcTemporal;
157+
),
158+
(
159+
Index: dbdtTimestamp;
160+
NativeTypes: '35';
161+
Name: 'TIMESTAMP';
162+
HasLength: False;
163+
RequiresLength: False;
164+
HasBinary: False;
165+
HasDefault: False;
166+
LoadPart: False;
167+
Category: dtcTemporal;
168+
)
169+
);
170+
171+
172+
implementation
173+
174+
end.

0 commit comments

Comments
 (0)