 <p>Assuming you already have a database connection called <code>db</code> set up, to get a list of the column names, you can use the following code:</p> <pre><code>do { let tableInfo = Array(try db.prepare("PRAGMA table_info(table_name)")) for line in tableInfo { print(line[1]!, terminator: " ") } print() } catch _ { } </code></pre> <p>where <code>table_name</code> is replaced with the literal string of your table's name.</p> <p>You can also add </p> <pre><code>print(tableInfo) </code></pre> <p>to see more pragma info about your table.</p> <p><strong>Credits</strong></p> <p>Thanks to <a href="http://stackoverflow.com/a/29866725/3681880">this answer</a> for clues of how to do this.</p>