检索数据库中所有表的列表数据库中、列表

2023-09-06 13:50:49 作者:犹豫

我按照通常的数据库文件夹该数据库文件和一堆表里面。

I have this database file under the usual databases folder and a bunch of tables inside it.

请注意,我不希望在命令行下检索。 我知道我可以使用.tables命令。

Please note that I don't want to retrieve under the command line. I know I can use the ".tables" command.

我要找回它的所有表的列表,使用code,这样我可以在他们每个人的执行一些特定的算法。

I want to retrieve a list of all tables in it, using code, so that I can execute some specific algorithms on each of them.

另外,我没有找到在Android这个问题的任何问题,所以请原谅我,如果有的话。我想知道是否有任何作用下 DatabaseUtils 我可以使用,但我没有发现任何要么。

Also, I didn't find any questions with this problem on Android, so please forgive me if there is any. I was wondering if there is any function I can use under DatabaseUtils, but I didn't find any either.

推荐答案

使用

select name from sqlite_master where type = 'table'