PHPackages                             phpolar/sqlite-storage - 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. phpolar/sqlite-storage

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

phpolar/sqlite-storage
======================

Adds support for storing data in SQLite databases.

1.1.2(5mo ago)0150MITPHPPHP &gt;=8.4CI passing

Since Nov 28Pushed 5mo agoCompare

[ Source](https://github.com/phpolar/sqlite-storage)[ Packagist](https://packagist.org/packages/phpolar/sqlite-storage)[ RSS](/packages/phpolar-sqlite-storage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (8)Used By (0)

PHPolar Sqlite Storage
======================

[](#phpolar-sqlite-storage)

Adds support for SQLite3 storage in your application.

 [![PHPolar logo](./phpolar.svg)](./phpolar.svg)

 [![Coverage Status Badge](https://camo.githubusercontent.com/6326e57031bb45c86235a69f1eb74b6a6d67d435ca473e796a1c3f77010832cb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7068706f6c61722f73716c6974652d73746f726167652f62616467652e7376673f6272616e63683d6d61696e)](https://camo.githubusercontent.com/6326e57031bb45c86235a69f1eb74b6a6d67d435ca473e796a1c3f77010832cb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7068706f6c61722f73716c6974652d73746f726167652f62616467652e7376673f6272616e63683d6d61696e) [![Latest Stable Version](https://camo.githubusercontent.com/cf0c9e3dec0006093038104719e20fcce8a7125cfd3213bbae1763b6e0c63f77/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f76)](https://camo.githubusercontent.com/cf0c9e3dec0006093038104719e20fcce8a7125cfd3213bbae1763b6e0c63f77/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f76) [![Total Downloads](https://camo.githubusercontent.com/6d8074f4d1efefc7ae9f11555ab699f8a94826386020e5f5b82a9d987ddae59a/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f646f776e6c6f616473)](https://camo.githubusercontent.com/6d8074f4d1efefc7ae9f11555ab699f8a94826386020e5f5b82a9d987ddae59a/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f646f776e6c6f616473) [![License](https://camo.githubusercontent.com/77d371cc39172e132a133f4057ae5afb1c741bf69974e9173922c50a96d159b5/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f6c6963656e7365)](https://camo.githubusercontent.com/77d371cc39172e132a133f4057ae5afb1c741bf69974e9173922c50a96d159b5/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f6c6963656e7365) [![PHP Version Require](https://camo.githubusercontent.com/4d5fbe7338499af7d78284d3bd258dea4b17837ddcb3db2d138f3b3af593294b/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f726571756972652f706870)](https://camo.githubusercontent.com/4d5fbe7338499af7d78284d3bd258dea4b17837ddcb3db2d138f3b3af593294b/68747470733a2f2f706f7365722e707567782e6f72672f7068706f6c61722f73716c6974652d73746f726167652f726571756972652f706870) [![Weekly Check](https://github.com/phpolar/sqlite-storage/actions/workflows/weekly.yml/badge.svg)](https://github.com/phpolar/sqlite-storage/actions/workflows/weekly.yml/badge.svg)

 [Website](https://phpolar.org/)

Quick start
-----------

[](#quick-start)

```
# create an example application

composer require phpolar/sqlite-storage
```

Objectives
----------

[](#objectives)

1. Keep project small. See [thresholds](#thresholds)
2. Automatically load and persist data

**Note** For more details see the [acceptance tests results](./acceptance-test-results.md)

### Example 1

[](#example-1)

```
$sqliteStorage = new SqliteStorage(
    connection: $connection,
    tableName: "table_name",
    typeClassName: Person::class,
);

$sqliteStorage->save($item1->id, $item);
$sqliteStorage->replace($updatedItem->id, $updatedItem);
$sqliteStorage->remove($item2->id);

$item3 = $sqliteStorage->find("id3")
    ->orElse(static fn() => new NotFound())
    ->tryUnwrap();

$allItems = $sqliteStorage->findAll();
```

Example Class for Items in Storage
----------------------------------

[](#example-class-for-items-in-storage)

```
use Phpolar\Phpolar\AbstractModel;

class Person extends AbstractModel
{
    #[PrimaryKey]
    #[Hidden]
    public string $id;

    public string $firstName;

    public string $lastName;

    public string $address1;

    public string $address2;

    public function getPrimaryKey(): string
    {
        return $id;
    }
}
```

Thresholds
----------

[](#thresholds)

ModuleSource Code Size \*Memory UsageRequiredphpolar/sqlite-storage9 kB150 kBx- Note: Does not include comments.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance71

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

165d ago

Major Versions

0.1.0 → 1.0.02025-11-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f34e51c09f71ccba1670d080b700e489cc2cffd43f4bed7684af4dff0195732?d=identicon)[phpolar](/maintainers/phpolar)

![](https://avatars.githubusercontent.com/u/40972462?v=4)[Eric Fortmeyer](/maintainers/ericfortmeyer)[@ericfortmeyer](https://github.com/ericfortmeyer)

---

Top Contributors

[![ericfortmeyer](https://avatars.githubusercontent.com/u/40972462?v=4)](https://github.com/ericfortmeyer "ericfortmeyer (18 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpolar-sqlite-storage/health.svg)

```
[![Health](https://phpackages.com/badges/phpolar-sqlite-storage/health.svg)](https://phpackages.com/packages/phpolar-sqlite-storage)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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