programster/pgsql-objects
Composer 安装命令:
composer require programster/pgsql-objects
包简介
A library for interfacing with a PostgreSQL database in PHP. Facilitates the creation of objects that represents tables tables. Objects must have id of type UUID.
关键字:
README 文档
README
This package aims to act as your object-relational-map (ORM) to a PostgreSQL database.
To use this package, we recommend you create two class files for each of your
tables. One should end in the word Table and represent operations on the
table itself. This should ideally extend the AbstractTable in the package.
If you need to create something rather special, then one can just implement
the TableInterface interface. Once you have extended the class, all you have
to do is fill in all of the abstract methods.
The second class you need to create is for a row/object of the table. This
class should extend the AbstractTableRowObject. Again, just fill in all of
the abstract methods for the package to be able to manage your tables.
Limitations
This package only works with tables that have an id column of type uuid.
Key Features
- Save/updates objects to the database for you when you want it to.
- implement an automatica local cache, so you don't re-fetch objects when you don't need to. E.g. if you make a call to MyTable::loadAll() before then trying to load a bunch of objects by ID, then the objects will be returned immediately without having to hit the database because they were all loaded into the cache.
- Supports cloning of the objects - will generate a new UUID for the clone and mark it as not being in the database. It will only be persisted if you save it to the database.
Testing
If you wish to create some changes and run the tests, simply fill in you
PostgreSQL host details into the /testing/settings.php.tmpl file and rename
it to /testing/settings.php.
Then run the tests with:
php testing/main.php
programster/pgsql-objects 适用场景与选型建议
programster/pgsql-objects 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.4k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 07 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 「postgresql」 「pgsql」 「models」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 programster/pgsql-objects 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 programster/pgsql-objects 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 programster/pgsql-objects 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
SilverStripe now has tentative support for PostgreSQL ('Postgres')
Dibi is Database Abstraction Library for PHP
Async Reactive Postgres Driver for PHP (Non-blocking)
Kinikit - PHP Application development framework MVC component
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
统计信息
- 总下载量: 1.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-04