Commit 7997c85
committed
SchemaReader: return the correct column definition for a composite primary key
The `PRAGMA` `table_info` that is used to return the column definitions,
returns one row for each defined column. The `pk` column contains:
> ... either zero for columns that are not part of the primary key, or the 1-based index of the column within the primary key).
See https://www.sqlite.org/pragma.html#pragma_table_info
Checking whether the `pk` column equals 1 only detects a single primary
key and ignores other columns that are part of a composite primary key.1 parent f1bee07 commit 7997c85
File tree
2 files changed
+38
-1
lines changed- Sources/SQLite/Schema
- Tests/SQLiteTests/Schema
2 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
93 | 130 | | |
94 | 131 | | |
95 | 132 | | |
| |||
0 commit comments