Converting LibPQ result into dataframe

So coming from R and Python I’m finding it astonishingly mysterious how I can connect to my Postgres DB and pull (select) data down into a dataframe format. I discovered the LibPQ package, but the documentation is very cursory, and doesn’t cover selecting data at all, much less converting that data into any paradigm I understand.

So, my question is: how do I transform the LibPQ result (from a select query) into a standard dataframe?

Thank you!

DataFrame(execute(conn, "SELECT * FROM table"))

This should work because LibPQ returns a table that comply with the Tables.jl interface.

4 Likes