Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixtures.db example error in sql-utils blog post #253

Closed
mroswell opened this issue Mar 31, 2021 · 2 comments
Closed

fixtures.db example error in sql-utils blog post #253

mroswell opened this issue Mar 31, 2021 · 2 comments

Comments

@mroswell
Copy link
Sponsor

En route to trying to understand column order transform documentation, I tried the instructions here:
https://simonwillison.net/2020/Sep/23/sqlite-advanced-alter-table/
I get a malformed database schema syntax error.

$ wget https://latest.datasette.io/fixtures.db
--2021-03-31 18:00:23--  https://latest.datasette.io/fixtures.db
Resolving latest.datasette.io (latest.datasette.io)... 2607:f8b0:4004:801::2013, 142.250.73.211
Connecting to latest.datasette.io (latest.datasette.io)|2607:f8b0:4004:801::2013|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: ‘fixtures.db’

fixtures.db                                                             [ <=>                                                                                                                                                              ] 260.00K  --.-KB/s    in 0.1s

2021-03-31 18:00:23 (2.41 MB/s) - ‘fixtures.db’ saved [266240]

$ sqlite3 fixtures.db '.schema facetable'
Error: malformed database schema (generated_columns) - near "AS": syntax error

$ sqlite3 fixtures.db
SQLite version 3.28.0 2019-04-15 14:49:49
Enter ".help" for usage hints.
sqlite> .schema
Error: malformed database schema (generated_columns) - near "AS": syntax error
@simonw
Copy link
Owner

simonw commented May 19, 2021

Thanks for pointing this out - the problem here is that these days the https://latest.datasette.io/fixtures.db example database includes a test for generated columns, which are a brand new feature in SQLite. Your local SQLite is an older version.

I'm going to update the blog post to instead use a copy of fixtures.db that doesn't use that feature.

@simonw
Copy link
Owner

simonw commented May 19, 2021

Fixed: https://simonwillison.net/2020/Sep/23/sqlite-advanced-alter-table/

@simonw simonw closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants