PHPackages                             easyswoole/fast-db - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. easyswoole/fast-db

ActiveLibrary[Framework](/categories/framework)

easyswoole/fast-db
==================

php stander lib

2.0.21(1mo ago)81.3k2[2 issues](https://github.com/easy-swoole/fast-db/issues)Apache-2.0PHPPHP &gt;=8.1

Since Jan 4Pushed 1mo agoCompare

[ Source](https://github.com/easy-swoole/fast-db)[ Packagist](https://packagist.org/packages/easyswoole/fast-db)[ Docs](https://www.easyswoole.com/)[ RSS](/packages/easyswoole-fast-db/feed)WikiDiscussions 2.x Synced today

READMEChangelog (10)Dependencies (10)Versions (67)Used By (0)

fast-db
=======

[](#fast-db)

`EasySwoole` 为了支持以 `PHP 8` 注解的方式来定义数据库对象映射，于是开发了 `fast-db` 这个数据库操作组件。

组件要求
----

[](#组件要求)

- php: &gt;= 8.1
- easyswoole/mysqli: ^3.0
- easyswoole/pool: ^2.0
- easyswoole/spl: ^2.0

安装方法
----

[](#安装方法)

```
composer require easyswoole/fast-db
```

连接注册
----

[](#连接注册)

### 在 EasySwoole 框架中使用

[](#在-easyswoole-框架中使用)

首先我们在 `EasySwoole` 框架的 `EasySwooleEvent` 事件（即框架根目录的 `EasySwooleEvent.php` 文件中）的 `initialize` 方法 或 `mainServerCreate`方法中进行注册连接，如下所示：

EasySwooleEvent.php

```
