EasySwoole踩坑记---数据库连接未注册

1,460 阅读1分钟

在跟着文档 快速开始--基础事例走的时候,在使用ORM进行查询的时候报错了

Argument 1 passed to EasySwoole\ORM\Utility\TableObjectGeneration::__construct() must be an instance of EasySwoole\ORM\Db\ConnectionInterface, null given, called in /www/wwwroot/estest/vendor/easyswoole/orm/src/Concern/Attribute.php on line 59

原因是少写了文档里红框中的的这个👇

也有可能是在dev.php里的配置放错地方了=.=可以把$config打出来试试