Skip to content

Commit

Permalink
sql/sqlite: in inspect command order columns by cid (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu authored Jan 5, 2023
1 parent 631e46a commit b8c6e2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/sqlite/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ const (
// Query to list database tables.
tablesQuery = "SELECT `name`, `sql` FROM sqlite_master WHERE `type` = 'table' AND `name` NOT LIKE 'sqlite_%'"
// Query to list table information.
columnsQuery = "SELECT `name`, `type`, (not `notnull`) AS `nullable`, `dflt_value`, (`pk` <> 0) AS `pk`, `hidden` FROM pragma_table_xinfo('%s') ORDER BY `pk`, `cid`"
columnsQuery = "SELECT `name`, `type`, (not `notnull`) AS `nullable`, `dflt_value`, (`pk` <> 0) AS `pk`, `hidden` FROM pragma_table_xinfo('%s') ORDER BY `cid`"
// Query to list table indexes.
indexesQuery = "SELECT `il`.`name`, `il`.`unique`, `il`.`origin`, `il`.`partial`, `m`.`sql` FROM pragma_index_list('%s') AS il JOIN sqlite_master AS m ON il.name = m.name"
// Query to list index columns.
Expand Down

0 comments on commit b8c6e2a

Please sign in to comment.