Re: [Dbix-class] belongs_to Error Case

2006-03-26 Thread Ash Berlin
Was speaking with castaway in IRC, and discovered belongs_to didn't seem to work (in this case) without fully specifying the package name: __PACKAGE__-belongs_to('role' = 'Role'); # The above line doesn't work, the below does #__PACKAGE__-belongs_to('role' = 'Schema::Role'); Ash (I sent this

Re: [Dbix-class] RFC: Documentation/manual improvements

2006-03-30 Thread Ash Berlin
Matt S Trout wrote: As of 0.06, we're doing substantially better documentation-wise due to the sterling efforts of a substantial number of contributors. But - getting all the interfaces documented, arguments, return values etc. included is a no-brainer. A more interesting question is - what

Re: [Dbix-class] Using sqlt with DBIx-Class schemas

2006-05-01 Thread Ash Berlin
Matija Grabnar wrote: For a project (in Catalyst, if it matters) I wanted to write a DBIx::Class schema first, then use sqlt to translate that schema into appropriate SQL commands to create the database. (I considered doing it the other way, but I don't think sqlt would correctly pick up

Re: [Dbix-class] searchable archive of the list?

2006-06-08 Thread Ash Berlin
John Napiorkowski wrote: Hey, Does anyone know of a place where this list has a searchable archive? I found it on google once, but I can't find it again and I am sure some of the questions I want to ask have been discussed before. --john

Re: [Dbix-class] quote char works with sorting without breaking too much!

2006-06-21 Thread Ash Berlin
A. Pagaltzis wrote: * Jess Robinson [EMAIL PROTECTED] [2006-06-21 11:15]: Ah, but this has fun with functions, which are currently supported as: order_by = [ { 'count' = '*'} ] .. etc At the last discussion of this, my end proposal was the following: order by = [ [ 'name', 'asc'],

Re: [Dbix-class] Example confusion -- my own

2006-06-22 Thread Ash Berlin
Alex Beamish wrote: So join = 'tracks' doesn't mean join to the `tracks' table, it means join to the `tracks' relationship, which happens to exist on the `track' table. Just like in the first example you gave `cd' didn't refer to a table, it referred to a relationship that

Re: [Dbix-class] quote char works with sorting without breaking too much!

2006-06-22 Thread Ash Berlin
A. Pagaltzis wrote: * Ash Berlin [EMAIL PROTECTED] [2006-06-22 13:50]: As for a go at taking that contrived CASE clause: { case = [ [ age = '' = 18 = 'NULL'], [age = '' = 45 = 'NULL'], ['age'] ] } Possible with WHEN/ELSE keys: { case = [ { where = 'age' = '' = 18 = 'NULL'}, {where

Re: [Dbix-class] creating a row that's empty but for an auto-incremented key?

2006-07-08 Thread Ash Berlin
John Siracusa wrote: On 7/8/06 12:35 AM, David Kamholz wrote: -- there doesn't seem to be a single right syntax for it. INSERT INTO foo; doesn't work for all databases. Some allow INSERT INTO foo DEFAULT VALUES;, but I believe that produces an error in mysql. So we haven't found a general

Re: [Dbix-class] Index-lookup in where clause.. Indexed stored procedure.

2006-07-11 Thread Ash Berlin
Jesper Krogh wrote: Jesper Krogh wrote: Unless you have a *VERY* good reason to keep the fields as one, split them out into two separate fields. That could be a solution.. but this database is in production, so that is not an option for now. You could argue that it would be the

Re: [Dbix-class] Problems with DBIx::Class SVN repository under Windows

2006-07-19 Thread Ash Berlin
Matt S Trout wrote: Nilson Santos Figueiredo Junior wrote: Hello, I don't know if anyone is already aware of this issue but, currently, it's not possible to check out the entire SVN repository under Windows. This happens because of the file: trunk/historical/rev1/r2/syntax?

Re: [Dbix-class] select * from function('param')

2006-07-28 Thread Ash Berlin
mock wrote: On Fri, Jul 28, 2006 at 12:38:59AM -0400, Daniel Westermann-Clark wrote: On 2006-07-27 22:38:02 +, mock wrote: So I've got a function in my Pg database which takes a single parameter and returns a set of rows. select * from function('param') works just fine from

Re: [Dbix-class] select * from function('param')

2006-07-28 Thread Ash Berlin
mock wrote: On Fri, Jul 28, 2006 at 12:20:54PM +0100, Ash Berlin wrote: mock wrote: Yeah, looks like I'm going to have to do the from hackery. So I tried the stupidly obvious: my $rs = $schema-resultset('Getcourses')-search(undef, { from = 'getcourses(\'STUDENT

[Dbix-class] Query Building Help

2006-08-10 Thread Ash Berlin
Right then guys: I am trying to build the following query: # SELECT # SUM(ABS(q.x_axis)) * MAX(ABS(a.value)) # FROM # tests_workplaceculture_answer a, # tests_workplaceculture_phaseanswer pa, # tests_workplaceculture_phase me, # tests_workplaceculture_question q # WHERE #

Re: [Dbix-class] Query Building Help

2006-08-10 Thread Ash Berlin
Brandon Black wrote: The only other change is that its selecting a lot more columns than you are, because you're using prefetch instead of plain join. Bingo - that was all that my problem was ___ List:

[Dbix-class] [Fwd: [Catalyst] [Announce] Relocated SVN mirror.]

2006-08-10 Thread Ash Berlin
Since Marcus didn't send to the DBIx list, I thought I'd forward here as well since DBIx::Class lives under bast Cheers Ash Original Message Subject:[Catalyst] [Announce] Relocated SVN mirror. Date: Wed, 9 Aug 2006 23:16:17 +0200 From: Marcus Ramberg [EMAIL

Re: [Dbix-class] Explicit ASTs (ping nate)

2006-09-02 Thread Ash Berlin
Matt S Trout wrote: SELECT my.a, my.b FROM my_table my WHERE spork = 1 and that would become { select = [ [ -name, 'my', 'a' ], [ -name, 'my', 'b' ] ], from = [ [ -alias, 'my_table', 'my' ] ], where = [ [ -op, '=', [ -name, 'spork' ], [ -bind, 1 ] ] ], } which is

Re: [Dbix-class] oops forgot the error message...

2006-09-29 Thread Ash Berlin
Devin Austin wrote: sorry all, Im also receiving this error message: Can't locate object method count via package EoD::DB::News at EoD.pm line 154. This is line 154: $row_data{'replies'} = $c-count; -- timorperfectus.com http://timorperfectus.com - web design to frightening

Re: [Dbix-class] DBIx::Class troubles with retrieving thread reply count on discussion software

2006-09-29 Thread Ash Berlin
Devin Austin wrote: Hi everyone, I'm new to this, but I thought I'd post a question. Im having trouble trying to retrieve the reply count to each thread in my message board software ( http://www.timorperfectus.com/users/devin/). I've tried a few things, but this is the current code I'm

Re: [Dbix-class] How to insert multiline fields

2006-10-04 Thread Ash Berlin
Marc Logghe wrote: First of - did you try it like you would with any normal parameter? $row-$colname($value); No, I did a create() call, setting all the fields. In case of the varchar, only the first line is inserted of the multiline string. In case of the clob I get an

Re: [Dbix-class] Using { count = 'me.list_id' } with AS hack from the FAQ

2006-10-10 Thread Ash Berlin
Kevin Old wrote: Hello everyone, I'm trying to use the hack defined in the FAQ for sort my results based on fields I've aliased using as with the following statement which includes a count. $schema-resultset(MyTable)-search(undef, { select = [ { count = 'list_id'} ], as = [ 'list_count' ]

Re: [Dbix-class] Proper way to escape underscores in DBIC (DBI 101, sorry)

2006-10-13 Thread Ash Berlin
Jules Bean wrote: apv wrote: I want/need to escape underscores so that simple searches can't be hacked by users, accidentally or intentionally. The DBI doc shows this as the way to do it: $esc = $dbh-get_info( 14 ); # SQL_SEARCH_PATTERN_ESCAPE $search_pattern =~

Re: [Dbix-class] Is anybody using Core components on there own?

2006-10-22 Thread Ash Berlin
Matt S Trout wrote: The original idea of DBIx::Class::Core was that it was a usual recipe for stuff, and that people would pick and choose the components required for their usage. But nobody actually seems to - I've done it once or twice but that code's now dead and the replacement just uses

Re: [Dbix-class] Feature request for DBIx::Class::InflateColumn::inflate_column

2006-10-27 Thread Ash Berlin
Matt S Trout wrote: Bernhard Graf wrote: In most cases I use the same inflator for multiple columns in a table. So instead of calling inflate_column with the same attributes for each column, I'd like to write __PACKAGE__-inflate_column(qw/col1 col2 col3/ = { inflate = sub {

Re: [Dbix-class] Feature request for DBIx::Class::InflateColumn::inflate_column

2006-10-28 Thread Ash Berlin
Bernhard Graf wrote: On Saturday 28 October 2006 00:19, Matt S Trout wrote: __PACKAGE__-inflate_column(qw/col1 col2 col3/ = { inflate = sub { Some:Class-inflate }, deflate = sub { shift-deflate }, }); What does this buy us over __PACKAGE__-inflate_column($_ = { inflate = sub {

Re: [Dbix-class] ok - opening salvo of questions!

2006-10-29 Thread Ash Berlin
Corey wrote: Mainly concerning DBIx::Class::ResultSource::add_columns(), and SQL::Translator::Producer::DBIx::Class::File . I created a pretty simple db (w/ postgresql ) call it 'MyDB'. I'll provide a tiny snippet of the portions relevant to my questions: CREATE TABLE animal ( id serial

Re: [Dbix-class] DBIx::Class::DigestColumns failes to test

2006-10-31 Thread Ash Berlin
Zbigniew Lukasiak wrote: I've looked into the issue with HTML::Widget::DBIC. At the line 49 of 100_create.t at I do: $schema-deploy({ add_drop_table = 1, }); and this should in my opinion clean the tables. In my system with SQL::Translator: 0.07 this works, and this is the latest CPAN

Re: [Dbix-class] Combining link tables

2006-10-31 Thread Ash Berlin
Will Hawes wrote: My database has a `file` table used to catalogue file meta info (mimetype, filename, size, etc). Over time various other tables have come to reference the file table (e.g. article, product, product_category) and I now have several link tables: article_file, product_file,

Re: [Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Ash Berlin
Kevin Old wrote: Hello everyone, I'm trying to use DBIx::Class with HTML::Template and I can't seem to get it to work. Here's how I'm calling DBIC and HTML::Template in my script: my $tmpl = HTML::Template-new( filename = single_stories.tmpl, die_on_bad_params = 1); my @stories =

Re: [Dbix-class] Using DBIx::Class with HTML::Template - anyone doing it?

2006-10-31 Thread Ash Berlin
Mike Friedman wrote: On 10/31/06, *Ash Berlin* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Not sure if thats a transposition error, but dont you want: if ( [EMAIL PROTECTED] ) { $tmpl-param( stories = [EMAIL PROTECTED] ); print $tmpl-output; } Actually

Re: [Dbix-class] Storable freeze/thaw on a column?

2006-11-26 Thread Ash Berlin
Mike Friedman wrote: Greetings, I'm looking at the docs for DBIx::Class::Serialize::Storable ( http://search.cpan.org/~bricas/DBIx-Class-0.07003/lib/DBIx/Class/Serialize/Storable.pm http://search.cpan.org/~bricas/DBIx-Class-0.07003/lib/DBIx/Class/Serialize/Storable.pm ) The Synopsis refers

Re: [Dbix-class] Relationship Bug

2006-12-02 Thread Ash Berlin
On 12/2/2006, Matt Hilliard [EMAIL PROTECTED] wrote: I believe I've come across a bug in BRICAS/DBIx-Class-0.07003.tar.gz, the synopsis is this: I'm running from a Catalyst context, I start with a DBIx::Class with 2 separate foreign keys to the same foreign table, both initially NULL, for

Re: [Dbix-class] order by desc

2006-12-06 Thread Ash Berlin
[EMAIL PROTECTED] wrote: how do u specify order by desc i.e. : $schema-resultset('table')-search({ order_by = 'field' } ); and then how do u specify DESCending order ? ** This communication (including any

Re: [Dbix-class] JOIN patch and inflate_columns patch

2006-12-06 Thread Ash Berlin
Bernhard Graf wrote: To Matt and maybe also other developers of DBIC: About one week ago I posted two patches for DBIC to the list after Matt asked me to add some tests. I would like to know, if these patches are acceptable and espially accepted now. The join-patch addresses a problem, that

Re: [Dbix-class] Spurious call to SELECT CONT(*) when accessing result_source.columns from a resultset

2006-12-07 Thread Ash Berlin
Jess Robinson wrote: On Wed, 6 Dec 2006, Matt S Trout wrote: As we discussed on IRC, this is a TT bug. I must have missed that.. can you elaborate for list-archive posterity please? Jess IIRC its a factor of the following in ResultSource.pm and how TT calls things: use overload

Re: [Dbix-class] Issue with sql names

2006-12-07 Thread Ash Berlin
Marc Espie wrote: On Thu, Dec 07, 2006 at 05:20:36PM +0100, Robert 'phaylon' Sedlacek wrote: Marc Espie wrote: The requests generated by DBIx::Class do not quote field names by default. Is there a way to get them quoted ? Even though this generates less readable SQL, this can be useful in some

Re: [Dbix-class] How not to fetch relational object?

2006-12-18 Thread Ash Berlin
$artist-get_column('cd') vti wrote: Is there a way how not to fetch a relational object? For example I have artist and cd. Relationships are trivial. When I write artist-cd I want to get just id in artist table, but actually I am getting cd object and to get id have to artist-cd-id which is

Re: [Dbix-class] where is the document for update

2006-12-19 Thread Ash Berlin
Wan wrote: I want to submit a SQL sentence to MySQL server like this UPDATE Config SET Value = '3' WHERE Name = 'hah' I don't know how to how to use the *update* method, DBIx::Class::Row and DBIx::Class::ResultSet are not details, I can't get useful information. Thanks for any help!

Re: [Dbix-class] Literals in relationships

2006-12-20 Thread Ash Berlin
Christopher Heschong wrote: Literals don't seem to work for relationships for me. For instance: my $foo = 'bar'; __PACKAGE__-has_many( 'things', 'MyApp::Schema::Thing', { 'foreign.key' = 'self.id', 'foreign.foo' = \$foo } ); doesn't seem to work. I'm probably

Re: [Dbix-class] branch status

2006-12-21 Thread Ash Berlin
Matt S Trout wrote: While I remember: can everybody with an active branch off -current sing out and tell us (1) what it's designed for source-handle branch - replaces all -result_source with a (schema,source_name) tuple. ``This module removes fixed link between Rows/ResultSets and the

Re: [Dbix-class] A problem with Postgres schemas

2006-12-28 Thread Ash Berlin
Kevin Esteb wrote: I new to DBIx::Class, so please bear with me. I am running RHEL4 and have a postgres database with a schema named analog. The DBIx::Class modules are the latest and greatest from CPAN, so is the DBD and the DBI for postgres. When I run the below code, I get this error:

Re: [Dbix-class] unnaccounted branches: ensure_source_loaded, ordered_handle_updates, privileges, replication

2006-12-31 Thread Ash Berlin
Matt S Trout wrote: Please can people tell me whether these are live or not? privileges looks not-really-started Basically yes. I was planning on coming up with some generic way of granting privileges. but there wasn't much to it in the end, and no real benefit over just -do('GRANT

Re: [Dbix-class] memcached

2007-01-24 Thread Ash Berlin
Jim Spath wrote: I was wondering if anyone had any suggestions for how to properly use memcached (http://www.danga.com/memcached/) with DBIx::Class. When one tries to store a resultset in memcached, you get the error Can't store CODE items, which makes sense. It seems like I really only

Re: [Dbix-class] modfiying data on retrieval

2007-03-05 Thread Ash Berlin
Dave Howorth wrote: Will Hawes wrote: On 05/03/07, Dave Howorth [EMAIL PROTECTED] wrote: I need to read data from a database where fields have been entered by hand and have miscellaneous extraneous leading and trailing whitespace. I think the best approach is to suppress these characters as I

Re: [Dbix-class] load_classes and common base class

2007-04-21 Thread Ash Berlin
Bill Moseley wrote: Ok, get ready for a bunch of beginner questions... What's the recommended was to setup a common base class for all the result sources (table classes)? A base class where I can put methods that can be called on any table object. Should I have each class inherit from a base

Re: [Dbix-class] load_classes and common base class

2007-04-21 Thread Ash Berlin
Bill Moseley wrote: On Sat, Apr 21, 2007 at 03:19:14PM +0100, Ash Berlin wrote: The way I do things is; Ok, so your result sources just inherit from a base class. Ok, so this has me wondering: # $self-resultset_class('My::ResultSet'); I noticed that in the cookbook. Are you using

Re: [Dbix-class] admin functions for the storage object?

2007-05-07 Thread Ash Berlin
Matt S Trout wrote: On Fri, May 04, 2007 at 08:48:22PM +0100, Jess Robinson wrote: On Fri, 4 May 2007, John Napiorkowski wrote: Hi, Not sure if this is something other people care about but I end up have to write some driver specific code for stuff like dis/enabling FK constraints and so

Re: [Dbix-class] Re: Return value of DBIx::Class::ResultSet::find()

2007-05-14 Thread Ash Berlin
A. Pagaltzis wrote: * Bernhard Graf [EMAIL PROTECTED] [2007-05-14 10:50]: But my email was not about a workaround for a probably common pitfall. Or do you call scalar() on each subroutine in a subroutine argument list by default? Depends on the interface of the functions in question. But yes,

Re: [Dbix-class] Defect in DBIC's doc (deploy).

2007-05-20 Thread Ash Berlin
Oleg Pronin wrote: Greetings. There is a small defect in docs: http://search.cpan.org/~blblack/DBIx-Class-0.07006/lib/DBIx/Class/Schema.pm#deploy_(EXPERIMENTAL) It is said that i need to add source_names to |$sqlt_args| containing an array reference of source

Re: [Dbix-class] Re: SELECT .. FOR ... (and other db-specific clauses).

2007-07-04 Thread Ash Berlin
Dami Laurent (PJ) wrote: [snip] SELECT ... WHERE NATIVE ('some db-specific syntax'). To do [snip] $rs-search_literal(NATIVE ('some db-specific syntax')); would do the job there. -ash ___ List:

Re: [Dbix-class] Delete with join bug

2007-07-15 Thread Ash Berlin
Juan Camacho wrote: There seems to be a bug with the following: $cart-options( 'option_id.group_id' = $group_id, { join = ['option_id'] } )-delete; What error does this give? Or does it just not work? ___ List:

Re: [Dbix-class] modifying join condition in search

2007-07-19 Thread Ash Berlin
Pedro Melo wrote: Hi, I have a relation defined like this: in Topics.pm: __PACKAGE__-has_many( watchers = 'PH::S::Watching', { 'foreign.topic_id' = 'self.id' }); In a search() I need to do a left join between Topics and Watching, but I need to add another

Re: [Dbix-class] Anybody else OSCONing?

2007-07-21 Thread Ash Berlin
Dylan Vanderhoof wrote: If you're interested in a beer on Friday (27th) early afternoon, let me know in advance. I'm heading to Portland for other reasons (Oregon Brewer's Festival) that day and would definitely be up for a pint around 1-2pm or so on Friday. -D I'd be interested to know

Re: [Dbix-class] [PATCH] Schema::Loader with reserved table name

2007-08-01 Thread Ash Berlin
Brandon Black wrote: On 8/1/07, Tatsuhiko Miyagawa [EMAIL PROTECTED] wrote: On 8/1/07, Matt S Trout [EMAIL PROTECTED] wrote: On Wed, Aug 01, 2007 at 12:06:37AM -0700, Tatsuhiko Miyagawa wrote: The following patch fixes some weird bugs when I used the table name 'show' with mysql. Wonder if