Skip to content

v3.0.0

Choose a tag to compare

@hparadiz hparadiz released this 26 Mar 08:40
9614439

This completes the v3 ORM/runtime refactor and closes the remaining release-blocking cleanup around model configuration and backend support.

What Changed

  • split the old MySQL-centric database layer into backend-aware runtime pieces:
    • Connections
    • StorageType
    • concrete MySQL and SQLite drivers
    • backend-specific query renderers
    • backend-specific schema writers
  • introduced first-class SQLite support across config, runtime, query rendering, schema generation, and test execution
  • extracted model read/hydration concerns into:
    • Factory
    • ModelMetadata
    • Instantiator
    • EventBinder
    • PrototypeRegistry
  • extracted lifecycle behavior from ActiveRecord into handler classes for save/delete/destroy/before-save/after-save/cache clearing/exception handling
  • reduced per-model boilerplate by making these optional for ordinary models:
    • $rootClass
    • $defaultClass
    • $subClasses
    • $singularNoun
    • $pluralNoun
  • kept explicit metadata support for real polymorphic roots and synthetic test models that intentionally need separate model identities
  • added v3 architecture documentation in docs/v3-architecture.md
  • linked the new architecture doc from the README and added a minimal model example near the top
  • fixed config override loading so config/db.dev.php is resolved relative to config/db.php

Why

The old architecture concentrated too much behavior in ActiveRecord and a single MySQL-oriented DB helper. This PR moves the framework toward explicit layers for:

  • backend resolution
  • query dialect selection
  • schema generation
  • model metadata
  • hydration
  • lifecycle orchestration

That makes the runtime easier to extend, gives SQLite real support instead of partial compatibility, and removes repetitive boilerplate from normal models.

Compatibility Notes

  • normal models no longer need to declare subclass metadata or noun labels unless they are intentionally overriding defaults
  • polymorphic roots like Media should still declare explicit subclass metadata
  • special test doubles or synthetic models that need their own root identity should also keep explicit metadata

Verification

  • composer test passes
  • MySQL: OK (221 tests, 539 assertions)
  • SQLite: OK (221 tests, 545 assertions)