pdo-document/index.md

42 lines
2.9 KiB
Markdown

---
_layout: landing
title: Welcome!
---
PDODocument is a PHP library that implements [relational document](/) concepts over PostgreSQL and SQLite.
## Installing
[![v1 Packagist Version](https://img.shields.io/badge/v1.0.0-blue?label=php%208.2)
](https://packagist.org/packages/bit-badger/pdo-document#v1.0.0)     [![Packagist Version](https://img.shields.io/packagist/v/bit-badger/pdo-document?include_prereleases&label=php%208.4)
](https://packagist.org/packages/bit-badger/pdo-document)
The library is [listed on Packagist][pkg] as `bit-badger/pdo-document`. v1.x targets PHP 8.2 and 8.3, while v2.x targets PHP 8.4 and up. Run `composer require bit-badger/pdo-document` (or add it to your `composer.json` manually), and it should select the appropriate version based on the target PHP version of your project.
## Using
- **[Getting Started][start]** provides an overview of the library, its configuration, and ensuring that tables and any required indexes exist.
- **[Basic Usage][basic]** details document-level retrieval, persistence, and deletion.
- **[Advanced Usage][advanced]** demonstrates how to use the building blocks provided by this library to write slightly-more complex queries.
## Why Would I Choose This?
Document stores have both advantages and disadvantages as compared to relational databases. Absent a unifying standard, relational database vendors have been implementing support for this to varying degrees. The project on which this is based, `BitBadger.Documents`, [has an examination of "why", and "why not"][why], one may choose this.
## Why Not _(other database with PDO support)_?
Of the [drivers that PDO supports][pdo], PostgreSQL and SQLite have the most mature JSON support. MySQL and MariaDB are very popular choices among PHP developers, but given their divergent paths, their JSON implementations differ - and neither, as of this writing, would fit into a complete document storage model.
## Source and Feedback
`PDODocument` is an [open-source project][src]; this Gitea instance does not _(yet)_ support public registrations. To provide feedback or ask questions about this library, e-mail "daniel" at this domain, or reach out to `@daniel@fedi.summershome.org` on the Fediverse (Mastodon) or `@Bit_Badger` on Twitter.
[pkg]: https://packagist.org/packages/bit-badger/pdo-document "PDODocument • Packagist"
[start]: ./docs/getting-started.md "Getting Started • PDODocument • Relational Documents"
[basic]: ./docs/basic-usage.md "Basic Usage • PDODocument • Relational Documents"
[advanced]: ./docs/advanced/index.md "Advanced Usage • PDODocument • Relational Documents"
[why]: /dotnet/#why-documents
[pdo]: https://www.php.net/manual/en/pdo.drivers.php "PDO Drivers • Manual • PHP.net"
[src]: https://git.bitbadger.solutions/bit-badger/pdo-document "PDODocument • Bit Badger Solutions Git"