implement pragma table_info

Both () and = variants covered. It is important to make sure that
the transaction is a read transaction, so we cannot hide all that logic
inside update_pragma, and have to make our decision before that.
This commit is contained in:
Glauber Costa
2025-01-30 15:26:02 -05:00
parent 249a8cf8d2
commit 016b815b59
4 changed files with 154 additions and 13 deletions

View File

@@ -1593,6 +1593,8 @@ pub enum PragmaName {
JournalMode,
/// trigger a checkpoint to run on database(s) if WAL is enabled
WalCheckpoint,
/// returns information about the columns of a table
TableInfo,
}
impl FromStr for PragmaName {
@@ -1603,6 +1605,7 @@ impl FromStr for PragmaName {
"cache_size" => Ok(PragmaName::CacheSize),
"wal_checkpoint" => Ok(PragmaName::WalCheckpoint),
"journal_mode" => Ok(PragmaName::JournalMode),
"table_info" => Ok(PragmaName::TableInfo),
_ => Err(()),
}
}