문제

Currently I am using something like this:

dbCreateTable db "MyTable" [ ("Col1", (StringT, False)), ("Col2", (StringT, False)) ]

which works fine, but i'd like to make "Col1" the primary key. Do i need to go back to raw SQL?

edit: This still seems to hold: "The part of creating a database from Haskell itself is not very useful, for example you cannot express foreign- and primary keys, indexes and constraints. Even the most simple database will need one of these."

From http://www.mijnadres.net/published/HaskellDB.pdf

도움이 되었습니까?

해결책

As the edit notes, HaskellDB is not very good at creating tables at the moment. It's best to build a database first, and then extract the info.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top