logoalt Hacker News

nodesocketyesterday at 9:56 PM1 replyview on HN

The biggest annoyance about SQLite for me is no ability to:

    ALTER TABLE users MODIFY COLUMN…

    ALTER TABLE users ALTER COLUMN…

    ALTER TABLE users ADD CONSTRAINT…

You have to create a new temporary table with correct schema, copy data into this new table, drop the old table, and then rename the temporary table.

Replies

simonwyesterday at 10:34 PM

They've been improving that recently:

2026-04-09 (3.53.0) - "Enhance ALTER TABLE to permit adding and removing NOT NULL and CHECK constraints"

I use my own sqlite-utils CLI/Python library to work around these limitations: https://sqlite-utils.datasette.io/en/stable/python-api.html#...

show 1 reply