Database Driver (Query Builder 21)


Database driver

If you need to customize the database driver, you need to custom implement the Connection class (or inherit think\db\Connection) and Builder class ( Or inherit think\db\Builder). For special drivers, you may also need to implement the Query class (or inherit think\db\Query).

The implementation of the specific database driver depends on your custom Connection class. You can refer to the official Oracle driver and mongo driver implementation.

Once you customize the database driver, for example, if you customize think\mongo\Connection, you need to configure it in the database configuration file:

'type'  =>   'think\mongo\Connection',
'query' =>   'think\mongo\Query',