mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 08:28:09 +02:00
* Add configconnection to TSQLDBRestConnection
git-svn-id: trunk@41630 -
This commit is contained in:
parent
b0535d8d0f
commit
b9abb510b8
@ -56,6 +56,7 @@ Type
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
Destructor Destroy; override;
|
||||
Procedure Assign(Source: TPersistent); override;
|
||||
Procedure ConfigConnection(aConn : TSQLConnection); virtual;
|
||||
Published
|
||||
// Always use this connection instance
|
||||
Property SingleConnection : TSQLConnection Read FConnection Write SetConnection;
|
||||
@ -879,14 +880,7 @@ begin
|
||||
if (Result=Nil) then
|
||||
begin
|
||||
Result:=CreateConnection;
|
||||
Result.CharSet:=aConnection.CharSet;
|
||||
Result.HostName:=aConnection.HostName;
|
||||
Result.DatabaseName:=aConnection.DatabaseName;
|
||||
Result.UserName:=aConnection.UserName;
|
||||
Result.Password:=aConnection.Password;
|
||||
Result.Params:=Aconnection.Params;
|
||||
if Result is TRestSQLConnector then
|
||||
TRestSQLConnector(Result).ConnectorType:=aConnection.ConnectionType;
|
||||
aConnection.ConfigConnection(Result);
|
||||
aConnection.SingleConnection:=Result;
|
||||
end;
|
||||
end;
|
||||
@ -1861,6 +1855,18 @@ begin
|
||||
inherited Assign(Source);
|
||||
end;
|
||||
|
||||
procedure TSQLDBRestConnection.ConfigConnection(aConn: TSQLConnection);
|
||||
begin
|
||||
aConn.CharSet:=Self.CharSet;
|
||||
aConn.HostName:=Self.HostName;
|
||||
aConn.DatabaseName:=Self.DatabaseName;
|
||||
aConn.UserName:=Self.UserName;
|
||||
aConn.Password:=Self.Password;
|
||||
aConn.Params:=Self.Params;
|
||||
if aConn is TSQLConnector then
|
||||
TSQLConnector(aConn).ConnectorType:=Self.ConnectionType;
|
||||
end;
|
||||
|
||||
|
||||
Procedure InitSQLDBRest;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user