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(6y ago)05PHPPHP &gt;=7.2.1

Since May 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/XHXHXHX/pro)[ Packagist](https://packagist.org/packages/xhxhx/mypro)[ RSS](/packages/xhxhx-mypro/feed)WikiDiscussions master Synced 2mo 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 32% 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

2539d 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

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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