PHPackages                             xhxhx/mypro - 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. [Database &amp; ORM](/categories/database)
4. /
5. xhxhx/mypro

ActiveLibrary[Database &amp; ORM](/categories/database)

xhxhx/mypro
===========

pdo

v1.0.1(7y ago)05PHPPHP &gt;=7.2.1

Since May 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/XHXHXHX/pro)[ Packagist](https://packagist.org/packages/xhxhx/mypro)[ RSS](/packages/xhxhx-mypro/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

pro
===

[](#pro)

基于PDO的一个简单地ORM
==============

[](#基于pdo的一个简单地orm)

[GitHub 项目地址](https://github.com/XHXHXHX/pro)

在用原生写脚本的时候怀念起框架中封装好的ORM，所以仿照laravel写了这个简版的ORM，可以链式操作。

#### SELECT:

[](#select)

```
 DB::table('class as c')
        ->select('c.name as class_name', 's.name as student_name', 's.age', 's.sex')
        ->leftJoin('relation_class_students as r', 'r.class_id', '=', 'c.id')
        ->leftJoin('students as s', 'r.student_id', '=', 's.id')
        ->where('c.grade', 1)
        ->where('c.class', 1)
        ->get();
```

#### UPDATE

[](#update)

```
    DB::table('class')
        ->where('grade', 2)
        ->where('class', 1)
        ->update([
            'teach' => '李老师',
        ]);
```

#### INSERT

[](#insert)

```
    DB::table('class')
        ->insert([
            'grade' => 3,
            'class' => 1,
            'name'  => '三年1班'
            'teach' => '李老师',
        ]);
```

### 安装

[](#安装)

`composer require xhxhx/mypro v1.0.2`

### 实现功能

[](#实现功能)

##### 条件函数

[](#条件函数)

- table()
- select()
- leftJoin()
- where() 支持数组或多参数形式
- orWhere()
- whereIn
- whereBetween
- group()
- order()
- offset()
- limit()

\###操作函数

- count()
- findIt()
- find()
- get()
- insert()
- update()
- delete()

数据库配置在Config/db\_config中

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae0199c273e57f1d69e29c3ffb99561a65aa0a9d2d21ed1eeb0ea6e4cd70b21d?d=identicon)[346077168@qq.com](/maintainers/346077168@qq.com)

---

Top Contributors

[![XHXHXHX](https://avatars.githubusercontent.com/u/24266463?v=4)](https://github.com/XHXHXHX "XHXHXHX (30 commits)")[![13912162720](https://avatars.githubusercontent.com/u/19905088?v=4)](https://github.com/13912162720 "13912162720 (3 commits)")

---

Tags

mysqlormpdo-mysqlphp

### Embed Badge

![Health badge](/badges/xhxhx-mypro/health.svg)

```
[![Health](https://phpackages.com/badges/xhxhx-mypro/health.svg)](https://phpackages.com/packages/xhxhx-mypro)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
