Hi Aur,<div><br></div><div>I don't know if you have seen the previous discussions, but it looks like you are moving towards creating a SQL relational algebra library. There are 2 such existing libraries. The original is haskellDB [1], and the new one is DSH [2].</div>
<div>I think this is a very promising direction for Yesod, and I think there is a lot to be gained by first looking at one of the existing libraries, and seeing if at least the inner core [3] can be used with our constructor interface. I think we should at least justify why we are not re-using them.</div>
<div><br></div><div>Also, I agree that it would be ideal to remove the declaration of which actions are used. There are some technical reasons for this, but at a minimum they should be justified/documented in the book.</div>
<div><br></div><div>Greg Weber</div><div><br></div><div>[1] <a href="http://hackage.haskell.org/package/haskelldb">http://hackage.haskell.org/package/haskelldb</a></div><div>[2] <a href="http://hackage.haskell.org/package/DSH">http://hackage.haskell.org/package/DSH</a></div>
<div>[3] <a href="http://hackage.haskell.org/package/TableAlgebra-0.1.5">http://hackage.haskell.org/package/TableAlgebra-0.1.5</a></div><div><br><div class="gmail_quote">On Sun, Mar 13, 2011 at 1:48 PM, Aur Saraf <span dir="ltr"><<a href="mailto:sonoflilit@gmail.com">sonoflilit@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Michael and everyone,<br>
<br>
I think that it is very repetitive to need to specify what actions can<br>
or cannot be done on every field.<br>
<br>
I think it would better be made part of the FieldType, at least<br>
letting you specify defaults that can be edited in the field<br>
specification.<br>
<br>
Also, I definitely see a need for FooIdEq as I'm toying with adding<br>
support for more complicated SQL right now.<br>
<br>
<br>
What I have working in a toy hacked environment:<br>
<br>
> showQuery $ do<br>
> selectAll (undefined :: Pet) -- hopefully I'll make it possible to select specific fields<br>
> where_ PetTypeEq Dog -- eventually I'll probably get "PetType .== Dog" to work<br>
> where_ PetOwner PersonAgeLt 12<br>
"SELECT * FROM Pet WHERE Pet.type=? AND Person.age<? AND<br>
Pet.id=Person.id JOIN Person"<br>
<br>
I'm currently modifying the TH to support generating<br>
<br>
> persistFilterToJoins :: Filter val -> [(SomePersistEntity, SomePersistEntity)]<br>
<br>
That I need in order to do this in more than a toy environment.<br>
<br>
When there'll be something half worth showing, I'll upload to git and<br>
invite everyone to help (since this is mostly over-my-head Haskell...<br>
I've been learning a lot from it).<br>
<div><div></div><div class="h5"><br>
On Sat, Mar 12, 2011 at 8:46 PM, Michael Snoyman <<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>> wrote:<br>
> On Sat, Mar 12, 2011 at 3:07 AM, Katsutoshi Itoh <<a href="mailto:cutsea110@gmail.com">cutsea110@gmail.com</a>> wrote:<br>
>> Hi<br>
>><br>
>> I had often wanted FooIdIn, FooIdEq on Foo Persistent type.<br>
>> Would you support this by default?<br>
>><br>
>> from japan.<br>
><br>
> As Max said, glad to see that you're safe.<br>
><br>
> For FooIdEq: I don't think there is any need, since it can be<br>
> expressed more succinctly with the "get" function. As for FooIdIn:<br>
> this *was* a recently requested feature. Maybe we can get it in for<br>
> the next release. I think it would make sense to add the In attribute<br>
> to the entity itself, eg:<br>
><br>
> mkPersist [$persist|<br>
> Person In<br>
> name String<br>
> age Int<br>
> |]<br>
><br>
> Any objections?<br>
><br>
> Michael<br>
><br>
> _______________________________________________<br>
> web-devel mailing list<br>
> <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
><br>
<br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
</div></div></blockquote></div><br></div>