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
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
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
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
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'],
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
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
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
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
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?
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
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
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
#
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:
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
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
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
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
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
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' ]
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 =~
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
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 {
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 {
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
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
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,
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 =
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
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
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
[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
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
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
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
$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
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!
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
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
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:
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
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
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
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
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
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
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,
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
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:
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:
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
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
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
53 matches
Mail list logo