mgleis/php-sqlite-key-value-store

A PHP library that implements a key/value store with SQLite as the persistence layer.

1.0.1 2024-12-04 17:59 UTC

This package is auto-updated.

Last update: 2025-06-06 10:50:19 UTC


README

A PHP library that implements a key/value store with SQLite as the persistence layer.

Use it for small projects / prototypes with at most hundreds or thousands of values.

Install

composer require mgleis/php-sqlite-key-value-store

Usage

$kv = new KeyValueStore();

Set a Key

$kv->set('key', 'value');

Get a Value by Key

$value = $kv->get('key');

Check if a key exists

$exists = $kv->has('key');

Delete by Key

$kv->delete('key');

Search by Value

$arr = $kv->searchValueStartsWith('text');
$arr = $kv->searchValueContains('text');

Search by Key

$arr = $kv->searchKeyStartsWith('text');
$arr = $kv->searchKeyContains('text');