tursodatabase / tursodatabase/libsql

[Feature] Allow sequence creation

Open
#1,504 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Description

Suggestion is to allow sequence creation as specified by SQL

Example of Definition

CREATE SEQUENCE sequence_1
start with 1
increment by 1
minvalue 0
maxvalue 100
cycle;

Example of Usage

select sequence_1.next_val

Motivation

  • Sqlite offers autoincrement, but exposing an autoincrement id to an API may expose the API to attacks
  • Some id techniques needs the usage of a sequence in order to enforce sequence and associating this sequence to other factors
  • The generate_sequence function is not capable of returning a new number from a sequence (as next_val)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are identified. Start by reviewing SQLite's existing autoincrement behavior and the generate_sequence function, then define the requested CREATE SEQUENCE syntax and sequence_1.next_val semantics. Done means sequence creation, configuration, cycling, and next-value retrieval work consistently with the stated SQL example.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, sqlite
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.