Reputation: 125
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?
Upvotes: 1
Views: 34
Reputation: 125
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.
Upvotes: 1