Hi Ryan,

"distinct" is a property of the result set, not a particular row, so you
pass distinct = true, like this:

find_first("author = ? and year_pub > ?", { "John Doe", 1995, order =
"year_pub asc", count = 5, fields = { "id", "title" }, distinct = true })

It is not much use if you are doing a find_first, and it likely puts a
heavier burden on your database server.

About your other question, just you likely have to remove tour existing
orbit, with "luarocks remove orbit --force", and then do "luarocks install
orbit" again. LR2 does not let you have different versions of a package that
has "binaries"...

--
Fabio Mascarenhas, Lablua
http://www.lua.inf.puc-rio.br


On Fri, Oct 30, 2009 at 1:44 AM, Ryan Pusztai <[email protected]> wrote:

> Hi Fabio,
>
> On Thu, Oct 29, 2009 at 4:15 PM, Fabio Mascarenhas <[email protected]>wrote:
>
>> I have just released Orbit 2.1.0 in the main LuaRocks repository. Here is
>> the changelog:
>>
>> * better decoupling of orbit and orbit.model
>> * support for anything with a match method as patterns
>> * new options for orbit.model finders: distinct, fields
>> * count option for orbit.model now limits number of rows in the SQL
>> * logging of queries in orbit.model
>> * overhaul of the "orbit" script: better options, --help, sets application
>> path
>> * content_type method in the web object to set content type
>> * support for PUT and DELETE (methods `dispatch_put` and
>> `dispatch_delete`)
>> * orbit.model.recycle(*conn_builder*, *timeout*) function, to make a
>> connection that automatically reopens after a certain time
>> * more samples in the samples folder, and a README
>> * added a "higher-order" $if to Orbit Pages, using features of Cosmo
>> 9.09.22
>>
>> Quite a list! I will be highlighting some of the new features in blog
>> posts during the next few days. The Orbit rock now installs the launchers
>> for Orbit pages, op.cgi and op.fcgi, as we are dropping the old Kepler
>> installer. This also means that the samples are a little more hidden: you
>> need to go to tour lib/luarocks/rocks/orbit/2.1.0-1/samples folder.
>>
>> The web pages for Orbit now live on http://keplerproject.github.com/orbit
>> .
>>
>>
> Looks great. Thanks for the updates.
>
> Two quick questions:
>
> 1. How do I use the new option 'distinct' in the finders. Like this: 
> find_first("author
> = ? and year_pub > ?", { "John Doe", 1995, order = "year_pub asc", count =
> 5, fields = { "id", "title" }, distinct = { "title" } })
>
> 2. How do you update an already installed Orbit install? I am new to the
> LuaRocks thing and want it to go smooth.
> --
> Regards,
> Ryan
>
> _______________________________________________
> Kepler-Project mailing list
> [email protected]
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> http://www.keplerproject.org/
>
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to