-
-
Notifications
You must be signed in to change notification settings - Fork 727
GENERATED column support #1116
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
Comments
I'm treating this as a bug - these columns should definitely be visible in Datasette. I created my own test database using SQLite from Homebrew like this:
|
It looks like But Compare https://latest.datasette.io/fixtures?sql=select+*+from+pragma_table_info%28%27searchable%27%29 to https://latest.datasette.io/fixtures?sql=select+*+from+pragma_table_xinfo%28%27searchable%27%29 - the |
Generated column support was added in SQLite 3.31.0, so any unit tests I write for this should use skipIf to only run on that version or later. |
This change will also have an impact on how hidden virtual FTS tables are displayed, since apparently those have some hidden columns: https://latest.datasette.io/fixtures?sql=select+*+from+pragma_table_xinfo%28%27searchable_fts%27%29
|
@simonw thanks for investigating so quickly. If it is undesirable to change that hidden behavior, maybe something like this is a suitable workaround:
|
I'm OK exposing hidden columns, unless someone comes up with a pressing reason not to. |
Ouch, the tests pass on my laptop but failed in CI: https://github.com/simonw/datasette/actions/runs/392367997 Lots of failures look like this:
Note the I wonder why it didn't fail on my laptop? |
Working on this in a pull request: #1117 |
Here's the problem: https://www.sqlite.org/changes.html#version_3_26_0
CI is running 3.22.0. |
I think this is a feature request... perhaps I should just try to contribute it myself, but thought I'd check in case support is planned already.
For a table with the following schema, datasette 0.51.1 doesn't pick up the GENERATED columns and the column list only contains
(rowid, body)
If I edit the SQL and select the generated columns, it will happily show them.At first glance it appears that
def table_column_details(conn, table):
would have to be refactored to use a different methodology to get the columns, sincePRAGMA table_info(deeds);
returns just0|body|TEXT|0||0
so maybe it wouldn't be worth it.The text was updated successfully, but these errors were encountered: