Part of the Phase 2 set of PostgreSQL-specific features beyond the built-in driver.
Problem
Sequences are fundamental to PostgreSQL — every SERIAL/BIGSERIAL column creates one — but they're currently invisible in Tabularis. Users who need to inspect a sequence's current value, reset it after a bulk import, or change its increment must drop out to raw SQL; there's no browsable representation of sequences anywhere in the UI.
Proposed approach
Add RPC methods for the sequence lifecycle, backed by pg_sequences and standard DDL:
| Operation |
SQL |
| List sequences |
SELECT * FROM pg_sequences WHERE schemaname = $1 |
| Get sequence details |
SELECT * FROM pg_sequences WHERE sequencename = $1 |
| Get current value |
SELECT currval('schema.seq') or last_value from pg_sequences |
| Reset sequence |
ALTER SEQUENCE schema.seq RESTART WITH $1 |
| Set sequence value |
SELECT setval('schema.seq', $1) |
| Create sequence |
CREATE SEQUENCE schema.seq [INCREMENT BY ...] [START WITH ...] |
| Drop sequence |
DROP SEQUENCE schema.seq |
Frontend integration
Sequences appear in the sidebar under a "Sequences" node, at the same level as Tables/Views/Routines. Double-click opens a detail panel showing increment, min/max, start, and current value.
Security considerations
Resetting a sequence can disrupt application logic (e.g. primary-key collisions if reset below the current max row id). The frontend should show a confirmation dialog before executing a reset, not fire it on a single click.
Acceptance criteria
Tests
test_get_sequences — lists all sequences in schema
test_get_sequence_details — returns increment, min, max, start, current
test_reset_sequence — verify value changes
test_create_and_drop_sequence — lifecycle
References
- Full spec:
docs/planning/03-phase-2-issue-16.md (2.1)
- Priority: Sprint 1 — high demand, straightforward
- Ships as: beta update as soon as this lands (no need to wait for the rest of Phase 2)
Part of the Phase 2 set of PostgreSQL-specific features beyond the built-in driver.
Problem
Sequences are fundamental to PostgreSQL — every
SERIAL/BIGSERIALcolumn creates one — but they're currently invisible in Tabularis. Users who need to inspect a sequence's current value, reset it after a bulk import, or change its increment must drop out to raw SQL; there's no browsable representation of sequences anywhere in the UI.Proposed approach
Add RPC methods for the sequence lifecycle, backed by
pg_sequencesand standard DDL:SELECT * FROM pg_sequences WHERE schemaname = $1SELECT * FROM pg_sequences WHERE sequencename = $1SELECT currval('schema.seq')orlast_valuefrompg_sequencesALTER SEQUENCE schema.seq RESTART WITH $1SELECT setval('schema.seq', $1)CREATE SEQUENCE schema.seq [INCREMENT BY ...] [START WITH ...]DROP SEQUENCE schema.seqFrontend integration
Sequences appear in the sidebar under a "Sequences" node, at the same level as Tables/Views/Routines. Double-click opens a detail panel showing increment, min/max, start, and current value.
Security considerations
Resetting a sequence can disrupt application logic (e.g. primary-key collisions if reset below the current max row id). The frontend should show a confirmation dialog before executing a reset, not fire it on a single click.
Acceptance criteria
Tests
test_get_sequences— lists all sequences in schematest_get_sequence_details— returns increment, min, max, start, currenttest_reset_sequence— verify value changestest_create_and_drop_sequence— lifecycleReferences
docs/planning/03-phase-2-issue-16.md(2.1)