Skip to content
Discussion options

You must be logged in to vote

Hello @grantneufeld,

SQLite does not provide this information:

sqlite> create table player(id integer primary key, name text, score int);
sqlite> create index myIndex on player(name) where score is not null;
sqlite> pragma index_info(myIndex);
| seqno | cid | name |
|-------|-----|------|
| 0     | 1   | name |
sqlite> pragma index_xinfo(myIndex);
| seqno | cid | name | desc |  coll  | key |
|-------|-----|------|------|--------|-----|
| 0     | 1   | name | 0    | BINARY | 1   |
| 1     | -1  | NULL | 0    | BINARY | 0   |

In order to test the schema, I'd instead suggest to test the content of sqlite_master:

let sql = try String.fetchOne(db, sql: "select sql from sqlite_master where nam…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@grantneufeld
Comment options

Answer selected by grantneufeld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants