Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB驱动增加支持配置builder和query参数,便于开发者自定义Builder和Query类实现 #494

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

lyz7805
Copy link
Contributor

@lyz7805 lyz7805 commented Aug 29, 2023

起因

官方文档数据库驱动中写到: 一旦自定义了数据库驱动,例如你自定义实现了think\mongo\Connection你需要在数据库配置文件中配置:

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

而官方MongoDB驱动却不能通过配置query参数实现自定义Query类,必须通过重写Connector::getQueryClass()方法才能实现自定义Query类,当然要自定义Builder类也是如此。

结果

于是参照官方PDOConnection增加querybuilder参数,同时修改对应获得两个类的方法实现修改参数即可自定义驱动,保持与官方文档一致。

@liu21st liu21st merged commit dc759e4 into top-think:3.0 Sep 4, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants