SQL Manage Sequences
The Sequences activity manages number-generator objects on PostgreSQL, MariaDB, SQL Server, and Oracle (SQLite is intentionally unsupported and shows an empty state). Use it to create, edit, drop, and audit sequences with a dual form/script editor and a live CREATE SEQUENCE preview.
The default view lists every sequence in the current database:
CREATE SEQUENCE definition.The editor toggles between Form and Script. Form mode surfaces every option the target dialect supports:
| Field | Meaning | Dialects |
|---|---|---|
| Name | Sequence identifier (read-only when editing). | All |
| Data Type | SMALLINT, INT, BIGINT, NUMERIC, etc. | PostgreSQL, SQL Server |
| Start With / Restart With | Initial value on create; re-anchor point on edit. | All |
| Increment By | Step between generated values (may be negative). | All |
| Min Value | NO MINVALUE or explicit lower bound. | All |
| Max Value | NO MAXVALUE or explicit upper bound. | All |
| Cache | Number of values pre-allocated per session for performance. | All |
| Cycle | Wrap around after hitting max/min. | All |
| Order | Guarantee ordered allocation across RAC nodes. | Oracle |
| Owned By | Bind the sequence's lifecycle to table.column. | PostgreSQL |
Every change updates the read-only preview at the bottom of the form. A typical PostgreSQL sequence:
CREATE SEQUENCE public.invoice_number_seq
AS BIGINT
START WITH 1000
INCREMENT BY 1
MINVALUE 1
NO MAXVALUE
CACHE 20
NO CYCLE
OWNED BY invoices.number;
Editing an existing sequence emits ALTER SEQUENCE statements:
ALTER SEQUENCE public.invoice_number_seq
RESTART WITH 5000
INCREMENT BY 1
CACHE 50;
Paste a hand-written CREATE SEQUENCE or ALTER SEQUENCE statement, then hit Execute. Use script mode when the form does not cover a niche clause (e.g. schema-qualified owners or dialect-specific extensions).
Use the row's Drop action or right-click menu. VisuaLeaf confirms, then issues DROP SEQUENCE. On PostgreSQL, sequences bound via OWNED BY are dropped automatically when their owning column is dropped.
SERIAL/BIGSERIAL shortcuts and OWNED BY.ORDER (RAC-safe ordering) and supports NOCACHE.NEXT VALUE FOR in DEFAULT.ENGINE=SEQUENCE clause.NEXTVAL() / NEXT VALUE FOR queries.USAGE or SELECT on sequences.Download and start managing your MongoDB databases with ease.
Download Free Trial