Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

This module denormalizes entities using database views or tables. Also known as star schema, snowflake schema, snowflaking, etc.

This is a tool used to assist business intelligence tools in consuming Drupal data without knowing Drupal internals (like how to join fields).

Inspired by http://drupal.org/project/etl with a different approach. Denormalizer does not use entity_load and also does not perform the "Load" part of ETL.

Warning: as this module creates databases and performs destructive operations on tables and views, take extra caution when using this module. There are sanity checks to prevent you from overwriting your own tables, but you've been warned!

To use, enable the module.

Add a hook to your custom module to define the data you want to denormalize. See hook_denormalizer_info():

/**
 * Implements hook_denormalizer_info().
 *
 * Provide a list of plain tables and entities that should be denormalized.
 */
function hook_denormalizer_info() {
  return array(
    // Plain Drupal table
    'location' => array(
      'base table' => 'location',
    ),
    // Typical entity
    'denormalized_table' => array(
      'entity_type' => 'node',
      'bundles' => array('page', 'story'),
      'changed_key' => 'changed',
    ),
    // Some external table
    'ScormActivity' => array(
      'base table' => 'ScormActivity',
      'external' => TRUE,
      'changed_key' => 'update_dt',
    ),
  );
}

Visit admin/config/development/denormalizer

Set prefixes and where you want your views or tables to be.

- View mode will create database views.
- Table mode will create tables and SELECT data into them. On the next run, they will incrementally update based on the primary key and the "changed" field.
- DB determines where these views or tables live. This is useful if you want to restrict access to a BI or ETL tool by putting denormalized data in a new database.

Use the "Create" tab to create/update views or tables.

Use the "Export" tab to see the SQL that will be used.

Related modules

  • Views fast field - build Views without entity_load()
  • Singer - export denormalizer info as a singer catalog file

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0-alpha1 Pre-release Jan 3, 2025