* Split out feature registration. Remove package units from uses clause

git-svn-id: trunk@63106 -
This commit is contained in:
michael 2020-05-01 14:05:13 +00:00
parent d66e94abd3
commit f213c8c84c
6 changed files with 121 additions and 66 deletions

1
.gitattributes vendored
View File

@ -12486,6 +12486,7 @@ tools/lazdatadesktop/lazdatadesktop.lpi svneol=native#text/plain
tools/lazdatadesktop/lazdatadesktop.lpr svneol=native#text/plain
tools/lazdatadesktop/lazdatadesktop.res -text
tools/lazdatadesktop/querypanel.res -text
tools/lazdatadesktop/reglddfeatures.pp svneol=native#text/plain
tools/lazres.lpi svneol=native#text/plain
tools/lazres.pp svneol=native#text/pascal
tools/lfm_to_lrs.sh svneol=native#text/plain

View File

@ -19,22 +19,6 @@
***************************************************************************
}
{
Adding support for new connection types requires implementing a Data Dictionary for your connection type
see fcl-db/src/datadict for many implementations.
When done so, add the unit to the uses clause in the implementation, register it in RegisterDDEngines
and likely add a connection callback to RegisterConnectionCallBacks.
}
{ MS-SQL server connection}
{$IF FPC_FULLVERSION>30001}
{$DEFINE HAVEMSSQLCONN}
{$ENDIF}
{ MySQL 5.6 and 5.7 connections }
{$IF FPC_FULLVERSION>30100}
{$DEFINE HAVEMYSQL5657CONN}
{$ENDIF}
unit frmmain;
@ -310,29 +294,8 @@ implementation
{ $DEFINE HAVEMSSQLCONN}
uses
frmselectconnectiontype,
// Data dictionary support for
fpdddbf, // DBF
{$ifndef win64}
fpddfb, // Firebird
fpddmysql40, // MySQL 4.0
fpddmysql41, // MySQL 4.1
fpddmysql50, // MySQL 5.0
fpddmysql51, // MySQL 5.1
fpddmysql55, // MySQL 5.5
{$ifdef HAVEMYSQL5657CONN}
fpddmysql56, // MySQL 5.6
fpddmysql57, // MySQL 5.7
{$endif HAVEMYSQL5657CONN}
fpddoracle, // Oracle
fpddpq, // PostgreSQL
{$endif}
fpddsqlite3, // SQLite 3
fpddodbc, // Any ODBC supported
{$ifdef HAVEMSSQLCONN}
fpddmssql,
{$endif HAVEMSSQLCONN}
frmimportdd,frmgeneratesql,fpddsqldb,frmSQLConnect,fpstdexports;
frmselectconnectiontype, reglddfeatures,
frmimportdd,frmgeneratesql,fpddsqldb,frmSQLConnect;
{ ---------------------------------------------------------------------
TMainform events
@ -452,8 +415,9 @@ begin
//
// Register DD engines.
RegisterDDEngines;
RegisterExportFormats;
// Register standard export formats.
RegisterStdFormats;
FRecentDicts:=TRecentDataDicts.Create(TRecentDataDict);
FRecentConnections:=TRecentConnections.Create(TRecentConnection);
FN:=SysToUTF8(GetAppConfigDir(False));
@ -586,25 +550,7 @@ end;
procedure TMainForm.RegisterDDEngines;
begin
{$ifndef win64}
RegisterFBDDEngine;
RegisterMySQL40DDEngine;
RegisterMySQL41DDEngine;
RegisterMySQL50DDEngine;
RegisterMySQL51DDEngine;
RegisterMySQL55DDEngine;
{$ifdef HAVEMYSQL5657CONN}
RegisterMySQL56DDEngine;
RegisterMySQL57DDEngine;
{$endif}
RegisterOracleDDEngine;
RegisterPostgreSQLDDengine;
{$endif}
RegisterSQLite3DDEngine;
RegisterODBCDDengine;
{$IFDEF HAVEMSSQLCONN}
RegisterMSSQLDDEngine;
{$ENDIF}
RegisterEngines;
end;
procedure TMainForm.RegisterConnectionCallBacks;

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
<LRSInOutputDirectory Value="False"/>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<AutoCreateForms Value="False"/>
<Title Value="Lazarus Data Desktop"/>
<Scaled Value="True"/>
@ -27,13 +27,13 @@
</PublishOptions>
<RunParams>
<local>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default">
<local>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T &apos;Lazarus Run Output&apos; -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</Mode0>
</Modes>
@ -65,7 +65,7 @@
<MinVersion Minor="1" Release="1" Valid="True"/>
</Item8>
</RequiredPackages>
<Units Count="13">
<Units Count="14">
<Unit0>
<Filename Value="lazdatadesktop.lpr"/>
<IsPartOfProject Value="True"/>
@ -143,6 +143,10 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Frame"/>
</Unit12>
<Unit13>
<Filename Value="reglddfeatures.pp"/>
<IsPartOfProject Value="True"/>
</Unit13>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -8,9 +8,10 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, frmmain, dicteditor, DBFLaz, frmimportdd,
frmgeneratesql, SQLDBLaz, lazdatadict, RunTimeTypeInfoControls, frmSQLConnect,
frmgeneratesql, RunTimeTypeInfoControls, frmSQLConnect,
ddfiles, frmselectconnectiontype,
lazdatadeskstr, lazdbexport, fraquery, fradata, fraconnection;
lazdatadeskstr, fraquery, fradata, fraconnection,
reglddfeatures;
{$R *.res}

View File

@ -0,0 +1,103 @@
unit reglddfeatures;
{
Adding support for new connection types requires implementing a Data Dictionary for your connection type
see fcl-db/src/datadict for many implementations.
When done so, add the unit to the uses clause in the implementation, register it in RegisterDDEngines
and likely add a connection callback to RegisterConnectionCallBacks.
}
{ MS-SQL server connection}
{$IF FPC_FULLVERSION>30001}
{$DEFINE HAVEMSSQLCONN}
{$ENDIF}
{ MySQL 5.6 and 5.7 connections }
{$IF FPC_FULLVERSION>30100}
{$DEFINE HAVEMYSQL5657CONN}
{$ENDIF}
{$IFDEF VER3_0_4}
{$DEFINE HAVEMYSQL5657CONN}
{$ENDIF}
{$mode objfpc}{$H+}
interface
uses
// Data dictionary support for database types
fpdddbf, // DBF
{$ifndef win64}
fpddfb, // Firebird
fpddmysql40, // MySQL 4.0
fpddmysql41, // MySQL 4.1
fpddmysql50, // MySQL 5.0
fpddmysql51, // MySQL 5.1
fpddmysql55, // MySQL 5.5
{$ifdef HAVEMYSQL5657CONN}
fpddmysql56, // MySQL 5.6
fpddmysql57, // MySQL 5.7
{$endif HAVEMYSQL5657CONN}
fpddoracle, // Oracle
fpddpq, // PostgreSQL
{$endif}
fpddsqlite3, // SQLite 3
fpddodbc, // Any ODBC supported
{$ifdef HAVEMSSQLCONN}
fpddmssql,
{$endif HAVEMSSQLCONN}
// code generators
{$IF FPC_FULLVERSION>=30200}
fpcgfieldmap,
fpcgtypesafedataset,
{$ENDIF}
fpcgSQLConst,
fpcgdbcoll,
fpcgCreateDBF,
fpcgtiOPF,
// data Export
fpstdExports,
fpxmlxsdexport,
fpdbexport
;
procedure registerengines;
procedure RegisterExportFormats;
implementation
procedure RegisterExportFormats;
begin
RegisterXMLXSDExportFormat;
RegisterStdFormats;
end;
procedure registerengines;
begin
{$ifndef win64}
RegisterFBDDEngine;
RegisterMySQL40DDEngine;
RegisterMySQL41DDEngine;
RegisterMySQL50DDEngine;
RegisterMySQL51DDEngine;
RegisterMySQL55DDEngine;
{$ifdef HAVEMYSQL5657CONN}
RegisterMySQL56DDEngine;
RegisterMySQL57DDEngine;
{$endif}
RegisterOracleDDEngine;
RegisterPostgreSQLDDengine;
{$endif}
RegisterSQLite3DDEngine;
RegisterODBCDDengine;
{$IFDEF HAVEMSSQLCONN}
RegisterMSSQLDDEngine;
{$ENDIF}
end;
end.