定制 bit-badger/pdo-document 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bit-badger/pdo-document

最新稳定版本:v3.0.0

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

v1 Packagist Version     v2 Packagist Version     Packagist Version

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::None is the default; no IDs will be generated
  • AutoId::Number will assign max-ID-plus-one to documents with an ID of 0
  • AutoId::UUID will generate a v4 UUID for documents with an empty string ID
  • AutoId::RandomString will generate a string of letters and numbers for documents with an empty string ID; Configuration::$idStringLength controls 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.

统计信息

  • 总下载量: 52
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固