Search by

trail / db

dodgycoffee

Database addon for trail

Package info

source.tube/brindly/trail-db

Issues

Type:trail-addon

pkg:composer/trail/db

Statistics

Installs: 46

Dependents: 3

Suggesters: 0

0.3.2 2026-10-05 05:05 UTC

This package is auto-updated.

Last update: 2026-10-05 20:13:29 UTC


README

Database addon for trail framework

install

composer require trail/db

run migrations

trail/trail db::migrate

write migrations

Theres a helper at $database->id() which gives an auto increment primary key for the db engine. made it easier for me

return static function (Connection $database): void {

    $database->run("
        create table notes (
            id {$database->id()},
            body text not null
        )
    ");
};

checkpoint (sqlite)

trail/trail db::checkpoint

sqlite runs with a persistent connection, so writes sit in db.sqlite-wal till they get added to the db. Run this before copying db file anywhere to make sure its updated

Notes

Only supports sqlite atm. postgres + mysql to come