waaseyaa/database-legacy

Database adapter wrapping Drupal DBAL. Interim until Doctrine migration.

Maintainers

Package info

github.com/waaseyaa/database-legacy

pkg:composer/waaseyaa/database-legacy

Statistics

Installs: 7 690

Dependents: 17

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0-alpha.218 2026-06-15 20:51 UTC

This package is auto-updated.

Last update: 2026-06-16 02:02:35 UTC


README

Layer 0 — Foundation

Database abstraction for Waaseyaa applications, wrapping Doctrine DBAL. Interim layer until a full Doctrine migration.

Namespace

Despite the package directory being database-legacy, the PHP namespace is Waaseyaa\Database (not Waaseyaa\DatabaseLegacy). The directory name is deliberate — see docs/adr/007-database-legacy-package-naming.md for the rationale.

API

DatabaseInterface exposes a fluent query builder and supporting services:

  • select() / insert() / update() / delete() — query builders (DBALSelect, DBALInsert, DBALUpdate, DBALDelete)
  • schema() — DDL via DBALSchema
  • transaction()DBALTransaction
  • query(), quoteIdentifier() — raw escape hatch + identifier quoting

DBALDatabase is the concrete implementation. DBALDatabase::createSqlite() builds an in-memory SQLite instance for tests.

$db = DBALDatabase::createSqlite();           // in-memory, for tests
$rows = $db->select('node', 'n')
    ->fields('n', ['id', 'title'])
    ->condition('n.status', 1)
    ->execute();

Query-builder notes (empty IN, LIKE escaping, fetchAssociative()) live in the root CLAUDE.md under "Database / DBAL".

Status

This is the framework's sole live database layer (depended on by core, api, entity-storage, audit, and ~12 other packages). A full retirement was implemented and merged, then reverted (2026-05-26); the package remains in active use pending the Doctrine migration. Do not treat "legacy" as "deprecated/removable".