Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

About question about pramga in sqlite command

45 views
Skip to first unread message

Jesus Rubio

unread,
Jun 2, 2024, 1:56:00 AM6/2/24
to Fat-Free Framework
Hi. I want to ask about the purpose from this sentence from sql.php, between lines 339, 343

$cmd=[
'sqlite2?'=>[
'SELECT * FROM pragma_table_info('.$this->quote($table).') JOIN ('.
'SELECT sql FROM sqlite_master WHERE (type=\'table\' OR type=\'view\')  AND '.
'name='.$this->quote($table).')',

In my case, f3 doesnt detect pragma_table_info and sqlite master so I split into two sentences.  

pragma table_info('.$this->quote($table).')',

However, I dont find the reason from this 

'SELECT sql FROM sqlite_master WHERE (type=\'table\' OR type=\'view\')  AND '.
'name='.$this->quote($table).')',

I check and It works well without her, So, what it is the purpose from this line?

Thank you.

ikkez

unread,
Jun 3, 2024, 3:24:59 AM6/3/24
to Fat-Free Framework
pragma_table_info returns information about the columns of a table, their datatype, nullable state and default value. The join with sqlite_master is only used to fetch the autoincrement flag, because that's not directly included in the pragma table info for a column.
Reply all
Reply to author
Forward
0 new messages