It means I must recreate a driver for every database connection type I work with (at least 3 at this point), and recompile my drivers after every release ?
I work with various versions of Delphi and DA in various virtual machines, so you can imagine this is not a small amount of work.
Why not make this a flag in the connection string ?
If I look in the code, it’s a simple property in an object which is requested from the connection, so that can be set from the connection string, I would think.
to be honest, you should spend a some time only once - for creating .cmd and .train file, similar to we use for [re]compiling sources. check C:\Program Files (x86)\RemObjects Software\Build forlder. you need this only if you need to have your own driver in DASM.
also is possible to use your own driver in run-time only.
it can replace existing driver.
for example, if you want to replace UniDAC driver:
code
unit uDAEFixedUniDACDriver;
interface
uses
uDAUniDACDriver, uDAEConnection, uDAServerInterfaces, uDADriverManager, SysUtils;
type
TDAEFixedUniDACDriver = class (TDAEUniDACDriver)
protected
function GetConnectionClass: TDAEConnectionClass; override;
end;
TDAEFixedUniDACConnection = class (TDAEUniDACConnection)
protected
function QuoteIdentifier(const iIdentifier: string): string; override; {$IFNDEF FPC_SAFECALL_BUG}safecall;{$ENDIF}
end;
function GetDriverObject: IDADriver; stdcall;
implementation
var
_driver: TDAEDriver = nil;
function TDAEFixedUniDACDriver.GetConnectionClass: TDAEConnectionClass;
begin
Result := TDAEFixedUniDACConnection;
end;
function TDAEFixedUniDACConnection.QuoteIdentifier(const iIdentifier: string): string;
begin
Result := iIdentifier;
end;
function GetDriverObject: IDADriver;
begin
if (_driver = nil) then _driver := TDAEFixedUniDACDriver.Create(nil);
result := _driver;
end;
initialization
_driver := nil;
UnregisterDriverProc(uDAUniDACDriver.GetDriverObject);
RegisterDriverProc(GetDriverObject);
finalization
UnregisterDriverProc(GetDriverObject);
FreeAndNIL(_driver);
end.
In this case, you can just use this driver instead of std Unidac driver in your server-side datamodule.