tapestry-cloud/database-plugin

Database plugin for Tapestry

0.5.3 2017-11-24 14:20 UTC

This package is auto-updated.

Last update: 2024-12-07 16:23:25 UTC


README

Syncs project state with database

Build Status Latest Stable Version License

This is a work in progress, which once complete will allow you to export the Tapestry project state to a database for manipulation by third party tools. In the case of Tapestry this is a precursor to the API plugin for an in browser admin panel.

Install

To install run composer require tapestry-cloud/database-plugin

Setup

Update your site configuration to include your database configuration:

// ...
    'plugins' => [
        'database' => [
            'driver' => 'pdo_sqlite',
            'path' => __DIR__ . DIRECTORY_SEPARATOR . 'db.sqlite'
        ]
    ]
// ...

Next within your site kernel.php you will need to register the plugins service provider within its boot method:

public function boot(){
    // ...
    
    $this->tapestry->register(\TapestryCloud\Database\ServiceProvider::class);
    
    // ...
}

Upon you next running tapestry build your database will be updated with the current project state.

Development

To run migrations use:

vendor\bin\doctrine.bat orm:schema-tool:update --force