Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paragonie/easydb-cache
EasyDB with Prepared Statement Caching
https://github.com/paragonie/easydb-cache
Last synced: 3 months ago
JSON representation
EasyDB with Prepared Statement Caching
- Host: GitHub
- URL: https://github.com/paragonie/easydb-cache
- Owner: paragonie
- License: mit
- Created: 2018-09-23T08:56:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T01:10:53.000Z (over 1 year ago)
- Last Synced: 2024-07-22T20:59:15.740Z (3 months ago)
- Language: PHP
- Size: 19.5 KB
- Stars: 30
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EasyDB (Caching)
[![Build Status](https://github.com/paragonie/easydb-cache/actions/workflows/ci.yml/badge.svg)](https://github.com/paragonie/easydb-cache/actions)
[![Latest Stable Version](https://poser.pugx.org/paragonie/easydb-cache/v/stable)](https://packagist.org/packages/paragonie/easydb-cache)
[![Latest Unstable Version](https://poser.pugx.org/paragonie/easydb-cache/v/unstable)](https://packagist.org/packages/paragonie/easydb-cache)
[![License](https://poser.pugx.org/paragonie/easydb-cache/license)](https://packagist.org/packages/paragonie/easydb-cache)
[![Downloads](https://img.shields.io/packagist/dt/paragonie/easydb-cache.svg)](https://packagist.org/packages/paragonie/easydb-cache)Extends [EasyDB](https://github.com/paragonie/easydb), caches Prepared Statements
to reduce the number of database round trips. **Requires PHP 8.0 or newer.**## Installing
```terminal
composer require paragonie/easydb-cache
```## Usage
To use EasyDB with prepared statement caching, you can either change the class you're importing
in your code, or update your code to use `EasyDBCache` instead. Alternatively, you can use the
named constructor with your existing object.Afterwards, the EasyDB API is exactly the same as EasyDBCache.
### Updating Import Statements
```diff
- use ParagonIE\EasyDB\EasyDB;
+ use ParagonIE\EasyDB\EasyDBCache;
```### Updating Your Code
```diff
use ParagonIE\EasyDB\EasyDB;
+ use ParagonIE\EasyDB\EasyDBCache;- $db = new EasyDB(
+ $db = new EasyDBCache(
```### Named Constructor
```diff
+ use ParagonIE\EasyDB\EasyDBCache;- $db = new EasyDB(/* ... */);
+ $db = EasyDBCache::fromEasyDB(new EasyDB(/* ... */));
```## Support Contracts
If your company uses this library in their products or services, you may be
interested in [purchasing a support contract from Paragon Initiative Enterprises](https://paragonie.com/enterprise).