Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  erlydb: order_by and "Unhandled extras"

ketralnis
Posted: Sun Nov 04, 2007 2:43 am Reply with quote
User Joined: 20 Jul 2007 Posts: 151 Location: San Francisco, CA
It doesn't look like the mnesia erlydb driver supports ordering as
well as the other erlydb drivers do. For instance, this doesn't work:

newest(Top,First) ->
post:find({id,'>',1},
[{order_by,[{created_on,desc}]},
{limit,First,Top}]).

It fails with:

ERROR erlang code crashed:
File: appmod:0
Reason: "Unhandled extras"
Req: {http_request,'GET',{abs_path,"/post/newest"},{1,1}}

But this *does* work:

newest(Top,First) ->
post:find({id,'>',1},
[{order_by,created_on},
{limit,First,Top}]).

(Note the simplified ordering.) The former looks almost exactly like
the one under "Protection against SQL injection attacks" at <http://
yarivsblog.com/articles/2006/09/30/erlydb-0-7/>, so I would assume
that it would work


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist
View user's profile Send private message AIM Address
Guest
Posted: Sun Nov 04, 2007 2:34 pm Reply with quote
Guest
Yeah, the driver is not really complete and will probably always lag
behind the sql drivers in terms of functionality since mnesia is not a
sql database. But, this looks like something that was just
overlooked. Unfortunately, the project I was using the mnesia driver
for was put on hold so I haven't been able to flush out this kind of
stuff.

If you would like to dive into the code and fix it that would be
great. The code could definitely use a second pair of eyes. Else,
I'll fix it as soon as possible. Let me know if you want a crack at
it...

On Nov 3, 10:42 pm, David King <dk...@ketralnis.com> wrote:
> It doesn't look like the mnesia erlydb driver supports ordering as
> well as the other erlydb drivers do. For instance, this doesn't work:
>
> newest(Top,First) ->
> post:find({id,'>',1},
> [{order_by,[{created_on,desc}]},
> {limit,First,Top}]).
>
> It fails with:
>
> ERROR erlang code crashed:
> File: appmod:0
> Reason: "Unhandled extras"
> Req: {http_request,'GET',{abs_path,"/post/newest"},{1,1}}
>
> But this *does* work:
>
> newest(Top,First) ->
> post:find({id,'>',1},
> [{order_by,created_on},
> {limit,First,Top}]).
>
> (Note the simplified ordering.) The former looks almost exactly like
> the one under "Protection against SQL injection attacks" at <http://
> yarivsblog.com/articles/2006/09/30/erlydb-0-7/>, so I would assume
> that it would work


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum