Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Sequences

10 sites Security covered
View on drupal.org

This module provides a service to generate unique sequences of IDs, replacing a deprecated core feature. It allows developers to request the next ID in a named sequence, with optional configuration for offsets per entity type to prevent conflicts.

The method `Drupal\Core\Database\Connection::nextId()` and the `sequences` table are deprecated in Drupal 10 and are
removed from Drupal 11. See https://www.drupal.org/node/3349345

This module brings back a database driven functionality to get sequences as a service using a simple API.

Usage

$sequence_name = 'my_sequence';
$next_id = \Drupal::service('sequences.generator')->nextId($sequence_name);

Furthermore you can configure offsets per entity type. This can avoid ID conflicts when syncing entities between instances.

Activity

Total releases
3
First release
May 2025
Latest release
9 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
1.0.1 Stable Oct 10, 2025
1.0.0 Stable May 20, 2025
1.0.x-dev Dev May 20, 2025