dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.06k stars 67 forks source link

<null> entries in .schema output #170

Closed mjpieters closed 7 months ago

mjpieters commented 8 months ago

SQLite creates internal indexes for primary keys and unique constraints, and the value for the sql column in the sqlite_schema system table is NULL for these. Thus, running .schema on any sqlite database with at least one table with a primary key or unique constraint results in <null> entries when you run .schema.

These should be filtered out; a WHERE sql IS NOT NULL filter should do. I don't see any need to filter out other internal objects (starting with sqlite_) here, they have their uses, but the output for internal indexes have no context and only confuse.