How to get full(er) table schema with HDBC

32 views Asked by At

HDBC beginner here. I'd like to view schemas for my tables. I know I can use describeTable to get the SqlColDesc for each table, but I'd also like to see primary and foreign keys, which SqlColDesc doesn't contain. Is there a way to access this information with HDBC or another Haskell interface?

1

There are 1 answers

0
thersites On

Update: I realized I could access the information with a query. Since I'm using the Sqlite3 backend for HDBC, the SQL is

select sql
from sqlite_master
where type="table";

I'll still have to extract the relevant metadata, since there don't seem to be any convenience functions for that.