sqlite3 c/c++, get the table names involved int an

2019-02-27 18:15发布

I am using sqlite in a C++ project and I would like to be able to get the table names involved in a query.

Ex:

SELECT * FROM Employee

should return Employee

Now I use successfully qlite3_column_table_name (doc) for this kind of queries but for aggregate queries, the function returns null as the result does not belong to a table directly.

ex:

SELECT SUM(salary) AS total FROM Employee

Surely, when sqlite compiles the statement, the "Employee" keyword is recognised as a table. Do you know aby way to have access to this? I tried to step through the code of the parser without success...

1条回答
够拽才男人
2楼-- · 2019-02-27 19:07

An authorizer callback allows you to detect which tables are actually accessed by a query.

查看更多
登录 后发表回答