Use custom DB driver with components

Hi there.


I've created a custom DBConnection Adapter based on TDriverConnectionAdapter. And are looking to see how to use it with Components aproach (instead of code only). What's the best (easyest) way?

Is there a way to use it with TAureliusConnection ? 
OR 
Is there a way to use it with TXDataConnectionPool ? 

Or I should create a custom TXDataConnectionPool to be able to use it with TXDataServer component?

Thanks for any hints

Regards,

Hello Anderson,

Use it in TAureliusConnection by registering the driver adapter and adding such code in a unit for a design-time package. Here is an example:



procedure RegisterDriverAdapter;
begin
  TAureliusAdapterRegister.Instance.RegisterAdapterFactory('FireDac',
    function(Args: TAdapterFactoryArgs): IDBConnection
      begin
        Result := TFireDacConnectionAdapter.Create(
          Args.AdaptedConnection as TFDConnection, Args.SqlDialect, Args.Owner);
      end
  );
end;


initialization
  RegisterDriverAdapter;

Hi Wagner, thanks for your help.


Tryed that but keep getting 'Adapter "MyAdapterName" not found"

1) "MyAdapterName" do not show at design-time in AureliusConnection.AdatpterName adapters list
2) Tryed setting AdapterName, AdaptedConnection and SQLDialect manually design-time and run-time. No luck

Any thougts?

Regards,

BTW, I'm using Delphi Rio 10.3.3

Ok, I think I solved, had to include the folowing before TAureliusAdapterRegister.Instance.RegisterAdapterFactory(



  TAureliusAdapterRegister.Instance.RegisterAdapter(IAureliusAdapter(
    TAureliusAdapter.Create(
      'MyAdapterName', 'TMyConnectionComp', 'Firebird3'))
  );


Now it shows in the list. I'm getting an access violation but probaply not related. I'll debug.

Thanks for your help.

Regards,