From Where The Database Is Connected


I have checked the core files. I was curious how the database is setup on cscart.

I finded out that the database is always connected to the storefront and just need to implement the queries.
I have looked in the Tygh files. In Database/Connection.php There the coded related to the database initiate, etc code is written. As well as in fn.database.php.

I want to know where the database is initialized like in where or in which file connect function is called to the connect database for the first time.

As, I have used grep command to look in which files db_initilize is used. It is used only once. and in that function only connect is written.

Can anyone guide me.

Please find connection to database here