From: Artyom S. <art...@gm...> - 2009-05-26 05:11:49
|
Hello, Is there a way to integrate HaskellDB TH utilities with DBDirect specifications? Looks like they are incompatible right now. What I would like is a single place to specify database schema. In addition to that, how hard is it to add primary keys, foreign keys and indices annotations to HaskellDB? Cheers, Artyom Shalkhakov. |
From: Justin B. <jgb...@gm...> - 2009-05-26 15:14:01
|
On Mon, May 25, 2009 at 10:11 PM, Artyom Shalkhakov <art...@gm...> wrote: > > Is there a way to integrate HaskellDB TH utilities with DBDirect specifications? > Looks like they are incompatible right now. What I would like is a > single place to > specify database schema. Can you be more specific? How are they incompatible? > > In addition to that, how hard is it to add primary keys, foreign keys > and indices > annotations to HaskellDB? > There isn't support for that at the moment, but it's kind of outside the domain too. I would suggest layering that information on top of your schema through additional types or classes. What did you have in mind? > Cheers, > Artyom Shalkhakov. > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > _______________________________________________ > Haskelldb-users mailing list > Has...@li... > https://lists.sourceforge.net/lists/listinfo/haskelldb-users > |
From: Artyom S. <art...@gm...> - 2009-05-27 05:44:58
|
2009/5/26 Justin Bailey <jgb...@gm...>: > Can you be more specific? How are they incompatible? At the moment, one has to provide a DB specification in terms of Database.HaskellDB.DBSpec, and the boilerplate code is generated automagically with DB/Direct. HaskellDB-TH on the other hand provides programmer with TH-specific functions while I think it would be much better if these functions operated over DB/Direct specifications: you give it a specification to get your boilerplate, as simple as that. The opportunity to have database schema as a first-class value is appealing. I would have already added that functionality to HaskellDB, but unfortunately, I'm not familiar with Template Haskell yet. >> In addition to that, how hard is it to add primary keys, foreign keys >> and indices >> annotations to HaskellDB? >> > > There isn't support for that at the moment, but it's kind of outside > the domain too. I would suggest layering that information on top of > your schema through additional types or classes. What did you have in > mind? I wanted to create a database table exclusively through HaskellDB; don't tell me I'm mad, please. :) Cheers, Artyom Shalkhakov. |
From: Justin B. <jgb...@gm...> - 2009-05-27 18:01:47
|
On Tue, May 26, 2009 at 10:44 PM, Artyom Shalkhakov <art...@gm...> wrote: > At the moment, one has to provide a DB specification in terms > of Database.HaskellDB.DBSpec, and the boilerplate code is generated > automagically with DB/Direct. HaskellDB-TH on the other hand provides > programmer with TH-specific functions while I think it would be much > better if these functions operated over DB/Direct specifications: you give > it a specification to get your boilerplate, as simple as that. > Cool idea! I don't have time to do it right now but I like it. It's a great opportunity to learn template haskell if you want to get a patch together :) > > I wanted to create a database table exclusively through HaskellDB; don't > tell me I'm mad, please. :) > Another good idea but I think something that falls outside haskellDB. You can create your own type-level info that represents what you want, though. You could use that along with a HaskellDB table definition to create the table w/ additional constraints. This paper on CoddFish, "Strong Types for Relational Databases (Functional Pearl)" by Alexandra Silva and Joost Visser, has a great tutorial on type-level programming in the first two sections, worth reading if you want to go that route: http://www.di.uminho.pt/~joostvisser/publications/StrongTypesForRDBs.pdf Justin |
From: Artyom S. <art...@gm...> - 2009-05-28 03:06:46
|
2009/5/28 Justin Bailey <jgb...@gm...>: >> I wanted to create a database table exclusively through HaskellDB; don't >> tell me I'm mad, please. :) >> > > Another good idea but I think something that falls outside haskellDB. Is the scope of the project outlined anywhere? It would be helpful to define it, I suppose. > You can create your own type-level info that represents what you want, > though. You could use that along with a HaskellDB table definition to > create the table w/ additional constraints. I'll see what I can do. > This paper on CoddFish, "Strong Types for Relational Databases > (Functional Pearl)" by Alexandra Silva and Joost Visser, has a great > tutorial on type-level programming in the first two sections, worth > reading if you want to go that route: > > http://www.di.uminho.pt/~joostvisser/publications/StrongTypesForRDBs.pdf Thanks for the link! Cheers, Artyom Shalkhakov. |