[Dbix-class] Excluding columns from a query

fREW Schmidt frioux at gmail.com
Wed Feb 24 20:39:12 GMT 2010


On Tue, Feb 23, 2010 at 12:26 AM, Darren Duncan <darren at darrenduncan.net>wr=
ote:

> fREW Schmidt wrote:
>
>> And after I write this I am planning on writing a module for
>> DBIx::Class::Helpers that will disable TEXT and BLOBs etc by default :-)
>>
>
> And what do you mean by that exactly?  Taken literally, it would exclude
> all character string data, which is very common, and you'd basically be l=
eft
> with numeric and date columns.  Perhaps you meant to say CLOBs rather than
> TEXT?  If you mean only long text columns, then how you specify this vari=
es
> greatly by DBMS, some of which don't have a literal "TEXT" AFAIK; so what
> criteria are you using to see if a character string column is short enough
> to include?  What is a reasonable cutoff?  Or would you return all charac=
ter
> string columns but truncate them to some maximum length suitable for givi=
ng
> a preview? -- Darren Duncan
>

Er, I didn't mean columns with text in them, I meant columns of type TEXT.
 TEXT !=3D char or varchar.  Of course in some DB's they are the same (sqli=
te)
but that's not really the point.  Basically my first cut will work like
this:

If coltype =3D=3D TEXT | BLOB | NTEXT
don't select it

Of course that will need to be tailored per db, but I'm in the business of
using my code, not perfecting it :-)
Point being that if people want it to work with their db which works
differently than I'm used to, patches are welcome.  The code should be super
simple, so helping should be easy.

As for your last question, regarding some kind of preview function, there is
no way I am doing that.  That would just be hassle city for me.  If you'd
like that functionality I'd be glad to discuss ways to implement it though
:-)
-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100224/aee=
98bf0/attachment.htm


More information about the DBIx-Class mailing list