Download the PHP package kenny1911/doctrine-views-sync without Composer
On this page you can find all versions of the php package kenny1911/doctrine-views-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package doctrine-views-sync
Doctrine Views Sync
[ English | Русский ]
Doctrine Views Sync is a lightweight utility for managing database views in Doctrine-based projects. It allows you to synchronize or drop all views via console commands.
Installation
Install the package via Composer:
Usage
Two console commands are available:
Drop all views
Drops all views in the database that are defined in your project.
Synchronize views
Synchronizes all views — recreates them based on the current application state.
Requirements
- PHP >= 8.1
- Doctrine DBAL
- Symfony Console (if used outside of Symfony, additional setup may be required)
Configuration
Symfony Framework
Example Symfony configuration using a single Doctrine connection.
Basic service registration and command wiring:
Services implementing the Kenny1911\DoctrineViewsSync\ViewsProvider
interface must be tagged with doctrine.views_provider
.
The doctrine.views_provider.locator
service is a PSR container where the connection name is used as the key, and the corresponding ViewsProvider
as the value.
In the doctrine.views.ignored
parameter specifies a list of database views that should be ignored.
Regular view names, glob patterns, and regular expressions are supported.
If you only use a single connection, you can use the Kenny1911\DoctrineViewsSync\Psr\Container\SingleValueContainer
.
For multiple connections, consider using Kenny1911\DoctrineViewsSync\Psr\Container\MapContainer
or the Symfony Tagged Locator.
Example ViewsProvider
implementation:
Development
Tests will run with in-memory sqlite db by default.
If you want to run tests with other dbms, set environment variable DATABASE_URL
.
File docker-compose.yml
contains prepared settings for different dbms. You must run database servers before run tests
and down after tests was passed.
Running tests example:
License
MIT
All versions of doctrine-views-sync with dependencies
doctrine/dbal Version ^3.0 || ^4.0
doctrine/persistence Version ^3.1|^4.0
psr/container Version ^2.0
symfony/console Version ^5.4 || ^6.0 || ^7.0