How to list all tables in sqlite.swift

609 Views Asked by At

Apparently I'm missing something here. Given you want to connect to an unknown sqlite database with multiple tables, is there a way to call something like .tables on

let db = try Connection("path/to/db.sqlite3")

to retrieve a list of tables and then create a reference to it. i tried (amongst other things)

 let statement = try db?.prepare("select * from sqlite_master where type='table'")
let tables = try statement!.run()

which returned a list of bindings, I have no idea how to deal with.

0

There are 0 best solutions below