PHPackages                             sugarcraft/sugar-skate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. sugarcraft/sugar-skate

ActiveLibrary[Database &amp; ORM](/categories/database)

sugarcraft/sugar-skate
======================

PHP port of charmbracelet/skate — a personal key/value store with multi-database support, binary data, and glob/list filtering.

00PHP

Since Jun 29Pushed 1mo agoCompare

[ Source](https://github.com/sugarcraft/sugar-skate)[ Packagist](https://packagist.org/packages/sugarcraft/sugar-skate)[ RSS](/packages/sugarcraft-sugar-skate/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![sugar-skate](.assets/icon.png)](.assets/icon.png)

[![CI](https://github.com/detain/sugarcraft/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/detain/sugarcraft/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/20dc0b6d5fe683c4604fbf4b15d257de7a63597649db94fe370655ec775027cf/68747470733a2f2f636f6465636f762e696f2f67682f64657461696e2f737567617263726166742f6272616e63682f6d61737465722f67726170682f62616467652e7376673f666c61673d73756761722d736b617465)](https://app.codecov.io/gh/detain/sugarcraft?flags%5B0%5D=sugar-skate)[![Packagist Version](https://camo.githubusercontent.com/bd3c131083d967b067ad1b39088aad5b922ed5316dbcdfea3b341142e48a1d0a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7375676172636f72652f73756761722d736b6174653f6c6162656c3d7061636b6167697374)](https://packagist.org/packages/sugarcore/sugar-skate)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/e78ffc83837c0d12647811a7fd1910c3cbeae04988de94bb4fd5b67e0874696a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135382e312d3838393262662e737667)](https://www.php.net/)

SugarSkate
==========

[](#sugarskate)

PHP port of [charmbracelet/skate](https://github.com/charmbracelet/skate) — a personal key/value store with multi-database support, binary data handling, and glob/list filtering.

Features
--------

[](#features)

- **Multi-database** — separate stores with `@dbname` suffix, auto-created on first use
- **Binary data** — safely stores and retrieves raw binary (images, files) via base64 encoding
- **Glob pattern matching** — list/get/delete keys using `*` and `?` wildcards
- **Ordered listing** — forward or reverse lexicographic order
- **Flexible listing** — keys only, values only, or key-value pairs
- **SQLite-backed** — one SQLite DB per database, stored in `$XDG_CONFIG_HOME/skate/` or `~/.config/skate/`
- **PHP 8.1+** — pure PHP, no extension required beyond SQLite (php-sqlite3)
- **Iterable streams** — list() yields results without loading everything into memory
- **TTL / expiry** — set keys that automatically expire after a given number of seconds
- **Levenshtein suggestions** — typo suggestions on key miss (get command prints to stderr)
- **Import/Export** — bulk load or save entries in JSON or YAML format, with optional atomic transaction
- **Atomic transactions** — Database::transaction() wraps a callback in BEGIN/COMMIT/ROLLBACK

Install
-------

[](#install)

```
composer require sugarcraft/sugar-skate
```

Quick Start
-----------

[](#quick-start)

```
use SugarCraft\Skate\Store;

$skate = new Store();

// Set and get
$skate->set('greeting', 'Hello, World!');
echo $skate->get('greeting'); // Hello, World!

// With a database
$skate->set('token', 'ghp_xxxx', 'passwords');
echo $skate->get('token', 'passwords');

// List all keys
foreach ($skate->list() as $entry) {
    echo "{$entry->key} => {$entry->value}\n";
}

// Glob patterns
foreach ($skate->list(pattern: 'user-*') as $entry) { ... }

// Delete
$skate->delete('greeting');
```

CLI
---

[](#cli)

```
skate set  [value] [--ttl=SECONDS]          # Set a key (reads stdin if no value)
skate get                                 # Get a value (suggests typo on miss)
skate list [-k|-v] [-r] [-d delim] [pattern]   # List entries
skate delete                               # Delete a key (glob patterns supported)
skate list-dbs                                   # Show all databases
skate import   [--no-atomic]   # Import entries (path=- for STDIN)
skate export  [db] [pattern]         # Export entries
```

### TTL (Time-To-Live)

[](#ttl-time-to-live)

Use `--ttl` to set keys that automatically expire:

```
skate set session:abc123 '{"user":"bob"}' --ttl=3600  # expires in 1 hour
```

### STDIN

[](#stdin)

When no value is given as an argument, `set` reads from stdin. For import, use `-` or `/dev/stdin` as the path:

```
echo "my-secret-token" | skate set api-token
skate import json -  dump.json
skate export yaml mydb 'user-*'  # export filtered keys from a specific database
```

The export output includes remaining TTL as a `_ttl` top-level key in JSON, or `skate_ttl_` entries in YAML.

Data Directory
--------------

[](#data-directory)

Default: `~/.config/skate/` (respects `$XDG_CONFIG_HOME`).

Each database gets its own SQLite file: `~/.config/skate/.db`.

Demos
-----

[](#demos)

### Glob pattern matching

[](#glob-pattern-matching)

[![glob](.vhs/glob.gif)](.vhs/glob.gif)

Shared foundations
------------------

[](#shared-foundations)

sugar-skate uses [candy-fuzzy](https://github.com/detain/sugarcraft#candy-fuzzy) for Smith-Waterman scored matching infrastructure. The matcher is wired for future fuzzy key search; glob-to-SQLIKE pattern filtering remains the active filter path today.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance59

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1036e0717211b8030b83cbe729e8ba6ba442fdbd5285fb97a39d7dcfe339342?d=identicon)[detain](/maintainers/detain)

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (74 commits)")

### Embed Badge

![Health badge](/badges/sugarcraft-sugar-skate/health.svg)

```
[![Health](https://phpackages.com/badges/sugarcraft-sugar-skate/health.svg)](https://phpackages.com/packages/sugarcraft-sugar-skate)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
