Skip to content

Commit

Permalink
Added comment about hidden columns
Browse files Browse the repository at this point in the history
  • Loading branch information
gorbit99 committed Jan 18, 2022
1 parent b351112 commit 2857d03
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions diesel_cli/src/infer_schema_internals/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ pub fn get_table_data(
) -> QueryResult<Vec<ColumnInformation>> {
let sqlite_version = get_sqlite_version(conn);
let query = if sqlite_version >= SqliteVersion::new(3, 26, 0) {
/*
* To get generated columns we need to use TABLE_XINFO
* This would return hidden columns as well, but those would need to be created at runtime
* therefore they aren't an issue.
*/
format!("PRAGMA TABLE_XINFO('{}')", &table.sql_name)
} else {
format!("PRAGMA TABLE_INFO('{}')", &table.sql_name)
Expand Down

0 comments on commit 2857d03

Please sign in to comment.