Hi Aur,<div><br></div><div>I don&#39;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">&lt;<a href="mailto:sonoflilit@gmail.com">sonoflilit@gmail.com</a>&gt;</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&#39;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>
&gt; showQuery $ do<br>
&gt;   selectAll (undefined :: Pet)       -- hopefully I&#39;ll make it possible to select specific fields<br>
&gt;   where_ PetTypeEq Dog            -- eventually I&#39;ll probably get &quot;PetType .== Dog&quot; to work<br>
&gt;   where_ PetOwner PersonAgeLt 12<br>
&quot;SELECT * FROM Pet WHERE Pet.type=? AND Person.age&lt;? AND<br>
Pet.id=Person.id JOIN Person&quot;<br>
<br>
I&#39;m currently modifying the TH to support generating<br>
<br>
&gt; persistFilterToJoins :: Filter val -&gt; [(SomePersistEntity, SomePersistEntity)]<br>
<br>
That I need in order to do this in more than a toy environment.<br>
<br>
When there&#39;ll be something half worth showing, I&#39;ll upload to git and<br>
invite everyone to help (since this is mostly over-my-head Haskell...<br>
I&#39;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 &lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt; wrote:<br>
&gt; On Sat, Mar 12, 2011 at 3:07 AM, Katsutoshi Itoh &lt;<a href="mailto:cutsea110@gmail.com">cutsea110@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hi<br>
&gt;&gt;<br>
&gt;&gt; I had often wanted FooIdIn, FooIdEq on Foo Persistent type.<br>
&gt;&gt; Would you support this by default?<br>
&gt;&gt;<br>
&gt;&gt; from japan.<br>
&gt;<br>
&gt; As Max said, glad to see that you&#39;re safe.<br>
&gt;<br>
&gt; For FooIdEq: I don&#39;t think there is any need, since it can be<br>
&gt; expressed more succinctly with the &quot;get&quot; function. As for FooIdIn:<br>
&gt; this *was* a recently requested feature. Maybe we can get it in for<br>
&gt; the next release. I think it would make sense to add the In attribute<br>
&gt; to the entity itself, eg:<br>
&gt;<br>
&gt; mkPersist [$persist|<br>
&gt; Person In<br>
&gt;    name String<br>
&gt;    age Int<br>
&gt; |]<br>
&gt;<br>
&gt; Any objections?<br>
&gt;<br>
&gt; Michael<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; web-devel mailing list<br>
&gt; <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
&gt;<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>