From the current Nette Database codebase, an Explorer object can only be created if it is registered as a service in DI. All the requirements for creating an Explorer object are defined only in DatabaseExtension instead of being encapsulated in a specialized Factory.
I am currently working on an application where there is no single common access to the database, but according to the permissions in a given request, the application dynamically obtains a PDO object with which it can work for the duration of the request (creating Connection from PDO is already open in #327).
If I am not mistaken, there is nothing to prevent the logic from DatabaseExtension from being transferred to a separate Factory that can be called independently of DI - which will allow for dynamic object creation.
Before I start working on the PR, I want to ask this issue whether the proposal makes sense to you.
From the current Nette Database codebase, an
Explorerobject can only be created if it is registered as a service in DI. All the requirements for creating anExplorerobject are defined only inDatabaseExtensioninstead of being encapsulated in a specialized Factory.I am currently working on an application where there is no single common access to the database, but according to the permissions in a given request, the application dynamically obtains a PDO object with which it can work for the duration of the request (creating
ConnectionfromPDOis already open in #327).If I am not mistaken, there is nothing to prevent the logic from
DatabaseExtensionfrom being transferred to a separate Factory that can be called independently of DI - which will allow for dynamic object creation.Before I start working on the PR, I want to ask this issue whether the proposal makes sense to you.