[objective-c]EGODatabase #3 全テーブル名の取得
EGODatabase*db=[EGODatabase databaseWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/database.db"]]; NSString*sql=@"select name from sqlite_master where type = 'table' order by name"; EGODatabaseResult*result=[db executeQuery:sql]; if (result.errorCode) {//failed return; } NSMutableArray*list=[NSMutableArray arrayWithCapacity:[result count]]; for (EGODatabaseRow*row in result) { [list addObject:[row stringForColumn:@"name"]]; }
参考サイト
enormego/egodatabase · GitHub
https://github.com/enormego/egodatabase