#1 2021-11-21 17:53:35

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 416

Mormot2: Setting fDatabase.ResourceOptions for Firedac

Looking to set the TfdConnection.ResourceOptions for manual queries from interface functions (using the mormot's connection pool), I found that it is not possible without changing the Mormot2 source.
I can get a TSqlDBFireDACConnection but it is not possible to set the fDatabase.ResourceOptions because it is readonly as a property.
I need to disable Macros (MacroCreate, MacroExpand) that cause problems to some queries and set ServerOutput based on Debug settings


Which is the best way to have access and change them when needed?

Last edited by dcoun (2021-11-21 18:00:38)

Offline

#2 2021-11-22 09:28:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,527
Website

Re: Mormot2: Setting fDatabase.ResourceOptions for Firedac

I don't understand... IIRC fDatabase.ResourceOptions returns a class instance, so you can change the current DB options here.

Offline

#3 2021-11-22 09:50:13

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 416

Re: Mormot2: Setting fDatabase.ResourceOptions for Firedac

I apologize. I was looking the TSqlDBConnection.
Migrated to ZEOS finally, to follow linux developments too

Last edited by dcoun (2021-11-22 10:25:32)

Offline

#4 2021-11-22 10:58:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,527
Website

Re: Mormot2: Setting fDatabase.ResourceOptions for Firedac

I have just created a new speCreated event which could be used to customize a database connection just after its creation, and before the connection.
It should work on all connection classes.

Offline

#5 2021-11-22 11:11:14

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 416

Re: Mormot2: Setting fDatabase.ResourceOptions for Firedac

ab wrote:

I have just created a new speCreated event which could be used to customize a database connection just after its creation, and before the connection.
It should work on all connection classes.

Thank you very much. That's helps a lot

Offline

Board footer

Powered by FluxBB