home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1683396150

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/sqlite-utils/issues/586#issuecomment-1683396150 https://api.github.com/repos/simonw/sqlite-utils/issues/586 1683396150 IC_kwDOCGYnMM5kVpY2 9599 2023-08-18T06:02:18Z 2023-08-18T06:06:31Z OWNER

More notes in here: - https://github.com/simonw/datasette-edit-schema/issues/35#issuecomment-1683392873

Not all Python/SQLite installations exhibit this problem by default!

It turns out this is controlled by the legacy_alter_table pragma: https://sqlite.org/pragma.html#pragma_legacy_alter_table

If that PRAGMA is turned on (default in newer SQLites) then alter table will error if you try to rename a table that is referenced in a view.

Here's a one-liner to test if it is on or not:

bash python -c 'import sqlite3; print(sqlite3.connect(":memory:").execute("PRAGMA legacy_alter_table").fetchall())'

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
1856075668  
Powered by Datasette · Queries took 1.17ms · About: github-to-sqlite