Re: [Dbix-class] DBIx::Class::Index::Simple

2008-04-02 Thread Mark Lawrence
On Wed Apr 02, 2008 at 08:50:02AM +0200, Peter Rabbitson wrote: > Mark Lawrence wrote: > >On Tue Apr 01, 2008 at 08:35:38PM -0500, Jonathan Rockway wrote: > >>* On Tue, Apr 01 2008, Peter Rabbitson wrote: > >> > >>> __PACKAGE__->add_colu

Re: [Dbix-class] DBIx::Class::Index::Simple

2008-04-01 Thread Mark Lawrence
n only index one column. Why > not do: > > __PACKAGE__->add_index( idx_foo_bar => [qw/foo bar/] ); How often do you need to know the name of an index? Why not go one simpler and do: __PACKAGE__->add_index(qw/foo bar/); Which could return the autogenerated nam

Re: [Dbix-class] Startup speed still too slow?

2008-03-18 Thread Mark Lawrence
ou are the kind of person who likes to automate CGI tests that way. For example, I often do the following which tells you why you are getting an Internal Server Error without having to tail/grep the webserver log file: HTTP_HOST=localhost REQUEST_URI=/some/path/ perl -Ilib bin/script.cgi See http

Re: [Dbix-class] Get generated SQL

2008-03-12 Thread Mark Lawrence
On Wed Mar 12, 2008 at 04:20:16PM +, Matt Lawrence wrote: > Mark Lawrence wrote: > >On Wed Mar 12, 2008 at 03:37:33PM +, Matt Lawrence wrote: > > > >>Mark Lawrence wrote: > >> > >>>On Wed Mar 12, 2008 at 12:30:14PM +, Matt Lawrence w

Re: [Dbix-class] Get generated SQL

2008-03-12 Thread Mark Lawrence
On Wed Mar 12, 2008 at 03:37:33PM +, Matt Lawrence wrote: > Mark Lawrence wrote: > >On Wed Mar 12, 2008 at 12:30:14PM +, Matt Lawrence wrote: > > > >>Mark Lawrence wrote: > >> > >>>You don't deal with binary (non-printable) data. Assu

Re: [Dbix-class] Get generated SQL

2008-03-12 Thread Mark Lawrence
On Wed Mar 12, 2008 at 12:30:14PM +, Matt Lawrence wrote: > Mark Lawrence wrote: > > > >You don't deal with binary (non-printable) data. Assuming this is method > >is for debugging purposes its usefulness is limited to pure text and > >won'

Re: [Dbix-class] Get generated SQL

2008-03-12 Thread Mark Lawrence
uot;$extra extra placeholder", $extra==1?'':'s', " in SQL"; > +} > +elsif (@bind_vals) { > +warn @bind_vals." extra bind parameter", @bind_vals==1?'':'s'; > +} > + > +return $sql; > +} You

Re: [Dbix-class] Get generated SQL

2008-03-11 Thread Mark Lawrence
my $quote = $self->dbh->quote($_); $sql =~ s/\?/$quote/; } } return $sql; } Feel free to use as you like. Mark. -- Mark Lawrence ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class

Re: [Dbix-class] Why is prefetch so slow?

2007-10-17 Thread Mark Lawrence
tions. Either have to do some more investigation into the reason for the overload (maybe there are some legitmate string comparisons somewhere), or ask the person who wrote it... Mark. -- Mark Lawrence ___ List: http://lists.scsys.co.uk/cgi-bin/mailma

Re: [Dbix-class] complex relationships I

2007-09-20 Thread Mark Lawrence
ication. If what you posted was simply some pseudo SQL then please ignore my ramblings. Regards, Mark. -- Mark Lawrence ___ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.or

Re: [Dbix-class] Advices needed on creating multilingual application

2007-09-19 Thread Mark Lawrence
On Wed Sep 19, 2007 at 04:16:32PM +0300, [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED]([EMAIL PROTECTED])@Wed, Sep 19, 2007 at 02:49:43PM +0300: > > Mark Lawrence([EMAIL PROTECTED])@Wed, Sep 19, 2007 at 12:58:24PM +0200: > > > On Wed Sep 19, 2007 at 11:50:26AM +0300, [EMAI

Re: [Dbix-class] Advices needed on creating multilingual application

2007-09-19 Thread Mark Lawrence
On Wed Sep 19, 2007 at 12:58:24PM +0200, Mark Lawrence wrote: > SELECT > t1.id, > CASCADE(t2.lang, t1.lang) AS lang, > CASCADE(t2.title, t1.title) AS title, > CASCADE(t2.body, t1.body) AS body, > FROM > entry

Re: [Dbix-class] Advices needed on creating multilingual application

2007-09-19 Thread Mark Lawrence
a related object that has a translation > too... That's a big mess for me. On the SQL side you can juse keep on adding CASCADEs and JOINs as many times as you want. Unfortunately this doesn't really translate well to pure Object(table)-

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-17 Thread Mark Lawrence
On Wed Sep 12, 2007 at 05:25:20PM +0100, Matt S Trout wrote: > On Thu, Sep 06, 2007 at 08:07:14PM +0200, Mark Lawrence wrote: > > > > Bitwise operators can be overloaded with Perl's overload.pm which is how > > SQL::DB (and Tangram, where I first saw thi

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-17 Thread Mark Lawrence
On Wed Sep 12, 2007 at 05:23:28PM +0100, Matt S Trout wrote: > On Thu, Sep 06, 2007 at 02:25:44PM +0200, Mark Lawrence wrote: > > > > The second reason is extensibility. Take for example > > SQL::Abstract::select (to be fair, the other query types are ok): > >

Re: [Dbix-class] RE: SQL Generation with SQL::DB

2007-09-12 Thread Mark Lawrence
t > the above code work? Looks perfectly valid to me, with the usual proviso's associated with parsing / interpolating strings. > Well, that's one of the situations I meant where SQL::DB could be useful > (even more in the example in point 4), *provided* that you resort to > s

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-12 Thread Mark Lawrence
to store, retrieve and manipulate a query, but I can see how that would be useful. I think the SQL::DB answer would be to store the inputs, not the abstract representation. The query only exists while it is being built. > In a word, it seems that SQL::DB is not very good to offer on abstract > representation of the queries, IMHO. I agree! > SQL::DB is cute, is very perlish and it is written in a very clean and > structured way (both the docs and the code), and I've certainly greatly > underestimated it (I apologize for that) and I largely missed its point. > > Nonetheless, I don't see any significant advantage over SQL::Abstract, > or rather, I see only disadvantages (albeit slight in the most common > cases), as shown in points 1, 2 and 4 above. > > Yet, it has a broader scope than SQL::Abstract and space to evolve. Thanks for the time and effort you've put into you mails. Has really helped me to clarify what SQLDB does and doesn't do. Cheers, Mark. -- Mark Lawrence ___ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-07 Thread Mark Lawrence
On Fri Sep 07, 2007 at 02:43:05PM +0200, Emanuele Zeppieri wrote: > Mark Lawrence wrote: > You instead just overload the operators and fully rely only on the Perl > expression parser, right? Yes! > So I misunderstood before, but that's probably even more limited than >

Re: [Dbix-class] RE: SQL Generation with SQL::DB

2007-09-07 Thread Mark Lawrence
On Fri Sep 07, 2007 at 02:12:31PM +0200, Emanuele Zeppieri wrote: > Mark Lawrence wrote: > > >foreach my $field ($form->param) { > >my @vals = $form->param($field) or next; > >$expr= $expr & ( @v

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-07 Thread Mark Lawrence
); } else { $expr = $expr & ($cd->year < $year); } } Cheers, Mark. -- Mark Lawrence ___ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Re: [Dbix-class] RE: SQL Generation with SQL::DB

2007-09-07 Thread Mark Lawrence
etc are also overloaded which may help to keep things clearer: ... where => $table->column gt ( $x < $y ? $y : $y ) > So ... I like it intellectually, but I'm not sure I would buy it for my > projects. I have to look into it in more details, though. Luckily I'm not

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-07 Thread Mark Lawrence
On Fri Sep 07, 2007 at 09:09:28AM +0200, Emanuele Zeppieri wrote: > Mark Lawrence wrote: > > >I'm not sure why people keep thinking SQL::DB requires more string > >manipulation than SQL::Abstract. Going back to one of the examples > >I first posted: > > &

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-06 Thread Mark Lawrence
On Fri Sep 07, 2007 at 01:23:48AM +0200, Emanuele Zeppieri wrote: > Mark Lawrence wrote: > >There is another *implicit* AND between the two conditions. At first > >(and second glance) this is very different from the actual intended SQL, > >not to mention the complexi

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-06 Thread Mark Lawrence
ely their big brothers (&&,||,not,and,or) cannot be overloaded. Because the bitwise ops have similar meanings to their counterparts their usage looks "close enough" to the real thing, so it doesn't take long to get comfortable with that. Mark. -- Mark Lawrence

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-06 Thread Mark Lawrence
7;t you?) I was referring to the syntax being an even closer approximation to the SQL, which in my mind has some benefit. I don't quite understand how your statement relates to that. > So I had to make a De Morgan's law engine inside my parser. Took me all of > two hours, and it works just peachy. That is my point. Relying on Perl's logic operators means that you don't have to do the De Morgan translations. The "!" equates directly as "NOT", and in the above case automatically applies to the combined condition inside the brackets. A direct mapping. Regards, Mark. -- Mark Lawrence ___ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-06 Thread Mark Lawrence
ssible to do this: my $age = $r->age; my $lname = $r->lname; where => $lname->like('%son%') & ! ($age < 10 | $age > 20 ) Thanks, Mark. -- Mark Lawrence ___ List: http://lists.rawmode.org/cgi-bin/mailman/li

Re: [Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-06 Thread Mark Lawrence
o select all columns from a table with an unknown structure? Or is it a question of efficiency? Regards, Mark. [1] I don't know SQL::Translator so can't comment there. However it looks to me like it does things backwards. SQL into Perl classes? Perl classes are near

[Dbix-class] [OT][ANNOUNCE] SQL Generation with SQL::DB

2007-09-05 Thread Mark Lawrence
eration part, SQL::DB is actually the module that ties this together with DBI. As is usually the case with early development, documentation is lacking, to say the least. So are a whole heap of unit tests and not every SQL expression has been implemented. However I've already successfully used SQL