6.9.1. pilotscope.Factory.DBControllerFectory
- class DBControllerFactory[source]
Bases:
object
- classmethod get_db_controller(config: pilotscope.PilotConfig.PilotConfig, echo=False, enable_simulate_index=False)[source]
Get a db controller instance based on the config. Each thread maintains a db controller instance with the same config. A new db controller instance will be created when the thread does not exist an instance or the config is different.
- Parameters
config – The config of PilotScope.
echo – Whether to print the SQL statement.
enable_simulate_index – Whether to enable the simulated index. This is only valid for PostgreSQL.
- Returns
A new or cached db controller instance.