berlioz/hector-package

Hector ORM package for Berlioz Framework

Maintainers

Package info

github.com/BerliozFramework/HectorPackage

Homepage

Issues

Type:berlioz-package

pkg:composer/berlioz/hector-package

Transparency log

Statistics

Installs: 5 945

Dependents: 0

Suggesters: 0

Stars: 0

v3.2.0 2026-07-02 09:44 UTC

This package is auto-updated.

Last update: 2026-07-02 10:00:32 UTC


README

Latest Version Packagist Dependency Version Software license

Note

This repository is a read-only split from the main Berlioz Framework repository.

For contributions, issues, or more information, please visit the main Berlioz Framework repository.

Do not open issues or pull requests here.

This package is intended to provide Hector ORM in Berlioz Framework.

📖 Full documentation

Installation

You can install Hector ORM Package for Berlioz Framework with Composer, it's the recommended installation.

$ composer require berlioz/hector-package

Migrations

This package integrates the Hector ORM migration component and exposes it through CLI commands.

Configure the migration source and tracker under the hector.migration key:

{
  hector: {
    migration: {
      // Provider supplying the migrations: 'directory' | 'psr4' | a container-resolvable FQCN
      provider: {
        type: 'directory',
        directory: '{config: berlioz.directories.app}/migrations',
        namespace: null, // required when type='psr4'
        pattern: '*.php',
        depth: 0
      },
      // Tracker recording applied migrations: 'db' | 'file' | a container-resolvable FQCN
      tracker: {
        type: 'db',
        table: 'hector_migrations',
        file: '{config: berlioz.directories.var}/hector.migrations.json'
      },
      schema: null // optional schema name to enable schema introspection
    }
  }
}

Commands

Command Description
hector:migrate Apply pending migrations
hector:migrate:down Revert applied migrations
hector:migrate:status Show the status of all migrations

Both hector:migrate and hector:migrate:down accept --dry-run and --interactive (-i):

# Apply all pending migrations
$ php berlioz hector:migrate

# Apply at most N pending migrations
$ php berlioz hector:migrate --steps=3

# Dry-run: compile and dispatch events without executing (native runner dry-run)
$ php berlioz hector:migrate --dry-run

# Interactive: ask for confirmation before each migration
$ php berlioz hector:migrate --interactive

# Revert the last migration, asking for confirmation
$ php berlioz hector:migrate:down --interactive

Documentation

For usage and examples, visit the official documentation on getberlioz.com.