beecubu/php-foundation-api-rest-sqlite

API-REST Framework plugin for SQLite backend.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/beecubu/php-foundation-api-rest-sqlite

v1.0.0 2026-02-04 18:14 UTC

This package is not auto-updated.

Last update: 2026-02-05 16:57:58 UTC


README

SQLite persistence plugin for php-foundation-api-rest. Provides repository implementations backed by SQLite and the bootstrap needed to register them.

What it provides

  • IUserRepository implementation (UserDB)
  • IPInfoCacheRepository implementation (IPInfoCacheDB)
  • RepositoryBootstrap to register both repositories

Installation

composer require beecubu/php-foundation-api-rest
composer require beecubu/php-foundation-api-rest-sqlite

Usage

1) Initialize repositories

use Beecubu\Foundation\ApiRest\SQLite\RepositoryBootstrap;

RepositoryBootstrap::init();

2) Configure SQLite storage

Ensure the SQLite file path used by your app is accessible and writable. The driver creates tables on demand.

3) Custom repositories (optional)

If you want to override the repositories:

use Beecubu\Foundation\ApiRest\Core\Persistence\RepositoryProvider;
use Beecubu\Foundation\ApiRest\SQLite\Core\Persistence\UserDB;
use Beecubu\Foundation\ApiRest\SQLite\Core\Persistence\IPInfoCacheDB;

RepositoryProvider::set(UserDB::current(), IPInfoCacheDB::current());

Notes

  • The core package is database-agnostic.
  • This plugin contains SQLite-specific repositories and query logic.