Search by

marko / database-sqlite

markshust

SQLite driver for Marko Framework Database Layer

Package info

github.com/marko-php/marko-database-sqlite

pkg:composer/marko/database-sqlite

Statistics

Installs: 1

Dependents: 7

Suggesters: 2

Stars: 0

0.13.0 2026-11-03 17:53 UTC

This package is auto-updated.

Last update: 2026-11-03 19:19:07 UTC


README

SQLite driver for the Marko framework database layer --- a zero-server database in a single file, or in memory.

Installation

composer require marko/database-sqlite

This automatically installs marko/database (the interface package) as a dependency. It needs ext-pdo_sqlite and SQLite 3.39 or newer.

Configuration

Create config/database.php. Only driver and database are required:

<?php

declare(strict_types=1);

return [
    'driver' => 'sqlite',
    'database' => 'storage/database.sqlite',
];

A relative database path resolves against the project root. Use :memory: for a throwaway database.

Quick Example

use Marko\Database\Connection\ConnectionInterface;

class MyService
{
    public function __construct(
        private ConnectionInterface $connection,
    ) {}

    public function doSomething(): void
    {
        $result = $this->connection->query('SELECT * FROM users');
    }
}

Documentation

Full usage, configuration, and API reference: marko/database-sqlite