[postmodern-devel] Retrieving completely populated DAOs based on SQL string query

Mitch Berkson mitch at bermita.com
Mon Oct 4 17:10:29 UTC 2010


  Here's one way I found to do this:
(select-dao 'foo-db-name (:in 'foo.id (:set (flatten (query "SELECT 
DISTINCT foo.id FROM foo, etc.")))))

On 10/4/2010 11:39 AM, Mitch Berkson wrote:
> I'd like to retrieve fully populated DAOs based on a SQL string query -
> preferably without naming all the columns.
>
> Using query-dao, I can get DAOs which have the columns I enumerate
> populated. For example, the following will retrieve DAOs with just the
> id slot populated.
>
> (query-dao 'foo-db-name "SELECT DISTINCT foo.id FROM foo, etc.")
>
> Alternatively, I can use select-dao to return complete DAOs, but I don't
> know how to write the test in the form of a SQL string to limit the DAOs
> that will be returned.
>
> So it would help me to know how to write a SQL string which can be used
> as a test for select-dao. Or a way to have query-dao retrieve fully
> populated DAOs. Thanks for any help.
>
> Mitch
>
> _______________________________________________
> postmodern-devel mailing list
> postmodern-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
>




More information about the postmodern-devel mailing list