Skip to content

series

Package series implements the generate_series table-valued function — an eponymous virtual table that yields a sequence of integers:

SELECT value FROM generate_series(1, 10); -- 1,2,…,10
SELECT value FROM generate_series(0, 100, 25); -- 0,25,50,75,100
SELECT value FROM generate_series(5, 1, -1); -- 5,4,3,2,1 (descending)

start and stop are required; step defaults to 1 and may be negative. (SQLite’s built-in generate_series treats stop as optional and unbounded; this port requires it to avoid an unbounded scan.)

Ported in spirit from SQLite’s series.c; see https://sqlite.org/series.html.


Full API: pkg.go.dev/gosqlite.org/ext/series