dolthub / dolthub/dolt

Support shared `auto_increment` value across tables

Open
#4,253 0 comments 0 reactions 0 assignees View on GitHub
enhancement sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Add support for a new type of `auto_increment` attribute that ensures values increment uniquely across multiple tables.

For example, consider the following tables:
```
CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT('shared-id-counter')
)

CREATE TABLE people (
id MEDIUMINT NOT NULL AUTO_INCREMENT('shared-id-counter')
)
```

The `animals` and `people` tables share the same scope for the ID auto_increment counter, so as rows are inserted, every ID should be unique and never reused across tables.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.