Skip to content

sqlite3.OperationalError: no such column: id #5

@simonw

Description

@simonw

Got this error trying to enable chronicle on a table that didn't have an id column. Turns out it was because of the new window function:

SELECT
{', '.join([f'"{col[0]}"' for col in primary_key_columns])},
{current_time_expr},
{current_time_expr},
ROW_NUMBER() OVER (ORDER BY id)
FROM "{table_name}";

ROW_NUMBER() OVER (ORDER BY id)

That needs to be ORDER BY then the full set of primary keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions