You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQLite: integers above 2147483647 are displayed wrapped to 32 bits (3000000000 shows as -1294967296) #1636
index.sql in an empty folder, default embedded SQLite:
createtableif not exists big(v integer);
deletefrom big;
insert into big(v) values (3000000000);
select'json'as component;
select v, cast(v astext) as v_text, typeof(v) as v_type, v +0as v_expr from big;
v comes back as -1294967296. The database holds the right value (v_text is "3000000000", v_type is integer). Other values follow the same rule, the value modulo 2^32 read as signed: 2147483648 shows as -2147483648, 4102444800000 (a millisecond timestamp) as 751032320, 9223372036854775807 as -1.
The table and csv components show the same wrapped number, and so do values passed on: sqlpage.link('item.sql', json_object('id', v)) builds a link with the wrong id, and set x = (select v from big) gives the string '-1294967296'.
REAL and TEXT columns are fine. A single-column select 3000000000 as v with no FROM also displays correctly.
What you expected
"v":3000000000, as stored. The docs say "Numbers, booleans, text, and NULL map naturally." (https://sql-page.com/extensions-to-sql, "From the database to SQLPage")
Database
SQLite
Database version
SQLite 3.54.1 (embedded in the v0.48.0 macOS binary)
SQLPage version
v0.48.0 (sqlpage-macos.tgz, macOS 27.2.1 arm64)
Last SQLPage version where it worked
Not tested on 0.47.0.
Anything else
Found by an AI agent's scripted checks while testing a CSV import and export app built from the docs. The page above was re-run as written on three fresh servers, two requests each, with the same output every time.
Activity