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?
Asked
Active
Viewed 28 times
1

thersites
- 125
- 4
-
`describeTable` is actually a class method, so there doesn't seem to be a particularly convenient generic way in `HDBC`. – dfeuer Oct 07 '20 at 20:46
1 Answers
1
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.

thersites
- 125
- 4