bit-badger/pdo-document
Composer 安装命令:
composer require bit-badger/pdo-document
包简介
Treat SQLite and PostgreSQL as document stores
README 文档
README
This library allows SQLite and PostgreSQL to be treated as document databases. It is a PHP implementation of the .NET BitBadger.Documents library.
Add via Composer
composer require bit-badger/pdo-document:^3
(Version 3 requires PHP 8.5 or greater.)
For the v1 series, the DocumentList type's members hasItems and items are functions; in the v2 series, they are properties. Additionally, the Option and Result types included in the project have a similar difference; see the v1 README for PHP 8.2 or 8.3 and the v2 README for PHP 8.4. Both versions are supported; the v1 / v2 distinction helps composer make the right choice based on the target PHP version of your project.
v1.2, v2.2, and v3 add a Field->andQualifier() function to modify the qualifier for a field and return the same instance. v3 also includes Field::withQualifier() which returns a new instance (and is designed for PHP 8.5's pipe operator); this makes it suitable for mapping an array of fields, adding a qualifier to them.
Configuration
Connection Details
The PDO data source name must be provided via Configuration::useDSN(). Configuration also has $username, $password, and $options variables that will be used to construct the PDO object it will use for data access.
Document Identifiers
Each document must have a unique identifier. By default, the library assumes that this is a property or array key named id, but this can be controlled by setting Configuration::$idField. Once documents exist, this should not be changed.
IDs can be generated automatically on insert. The AutoId enumeration has 4 values:
AutoId::Noneis the default; no IDs will be generatedAutoId::Numberwill assign max-ID-plus-one to documents with an ID of 0AutoId::UUIDwill generate a v4 UUID for documents with an emptystringIDAutoId::RandomStringwill generate a string of letters and numbers for documents with an emptystringID;Configuration::$idStringLengthcontrols the length of the generated string, and defaults to 16 characters
In all generated scenarios, if the ID value is not 0 or blank, that ID will be used instead of a generated one.
Usage
Full documentation is available on the project site.
bit-badger/pdo-document 适用场景与选型建议
bit-badger/pdo-document 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 06 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「sqlite」 「postgresql」 「document」 「pdo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bit-badger/pdo-document 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bit-badger/pdo-document 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bit-badger/pdo-document 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
SilverStripe now has tentative support for PostgreSQL ('Postgres')
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
The tenancy/tenancy database driver for sqlite
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Slimmed down concise interfaces and query builder for database queries and transactions which can be layered / decorated.
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-08