|
|
[Dbix-class] executing pl/sql block in dbic
By Marc Lambrichs | Mélange IT at Aug 3, 2007, 6:17 pm UTC
How should I handle executing a pl/sql-block in dbic? Actually I =20 think there should be 2 answers to this question: 1. If you just want to execute an arbitrary block of pl/sql, you =20 should be able to call it from an DBIx::Class::Schema instance. 2. If you wanted to call a stored procedure,... More...
How should I handle executing a pl/sql-block in dbic? Actually I think there should be 2 answers to this question:
1. If you just want to execute an arbitrary block of pl/sql, you should be able to call it from an DBIx::Class::Schema instance. 2. If you wanted to call a stored procedure, say a function that returns an id of a table 'account' for instance, you would like to add a wrapper subroutine that automagically inflates the id to the appropriate object. I'm not sure if this should be part of the schema.
Cheers,
Marc Lambrichs ================================== Mélange IT B.V. http://www.melange-it.com ==================================
0 Replies
|
|
|
[Dbix-class] Updating foreign key does not reload related object
By brett gardner at Aug 3, 2007, 3:42 pm UTC
I have a row object which has a field "venue_id" which is a foreign key used in a belongs_to relationship "venue". When I do the following. $old_venue = $event->venue; $event->venue_id($new_id); $event->update; $new_venue = $event->venue; "$new_venue" is not the venue with primary key "$new_id", it... More...
I have a row object which has a field "venue_id" which is a foreign key used in a belongs_to relationship "venue".
When I do the following.
$old_venue = $event->venue; $event->venue_id($new_id); $event->update; $new_venue = $event->venue;
"$new_venue" is not the venue with primary key "$new_id", it is the same row as "$old_venue".
Is this meant to update automatically or is this a feature not yet implemented?
Cheers, Brett Gardner Clientcomm
4 Replies
|
|
|
[Dbix-class] Transaction depth problem
By Dave Cardwell at Aug 3, 2007, 2:40 pm UTC
Hello there. When I run the attached script the call to txn_do() seems to create a transaction depth of two, so the insert is never actually committed. I see the insert in the MySQL log and the auto increment value of the primary key is increased, but the row of data is never actually inserted. I... More...
Hello there.
When I run the attached script the call to txn_do() seems to create a transaction depth of two, so the insert is never actually committed. I see the insert in the MySQL log and the auto increment value of the primary key is increased, but the row of data is never actually inserted.
I have included: ./test.pl ./TestDB.pm ./TestDB/Registration.pm
The table schema is in Registration.pm.
1 Reply
|
|
|
[Dbix-class] Character set help
By Michael Higgins at Aug 1, 2007, 8:37 pm UTC
Folks -- Problem is going from microsoft SQL server via Freetds/unixODBC. FEX, TSQL shell shows correct data encoding in query results. But with DBIx::Class, a '?' is coming across, killing the app. Where do I try to find the problem? First, I determined issue is not with Freetds. Must be in DBIC?... More...
Folks --
Problem is going from microsoft SQL server via Freetds/unixODBC. FEX, TSQL shell shows correct data encoding in query results.
But with DBIx::Class, a '?' is coming across, killing the app.
Where do I try to find the problem? First, I determined issue is not with Freetds. Must be in DBIC? How do I tweak the setting to get the right encoded data?
Cheers,
4 Replies
|
|
|
[Dbix-class] an error about search_related
By chylli at Aug 1, 2007, 4:36 pm UTC
HI: I have three tables described as Catalyst::Plugin::Authorization: Roles, UserRole, Users: Roles.pm is: __PACKAGE__->add_columns( "id", "role", __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint( "role_2", ["role"] ); __PACKAGE__->has_many( map_user_role =>... More...
HI: I have three tables described as Catalyst::Plugin::Authorization: Roles, UserRole, Users:
Roles.pm is: __PACKAGE__->add_columns( "id", "role", ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->add_unique_constraint( "role_2", ["role"] );
__PACKAGE__->has_many( map_user_role => 'K68::Db::K68::UserRole', { 'foreign.role_id' => 'self.id' } );
__PACKAGE__->many_to_many( "users" => "map_user_role", "user" );
UserRole.pm is:
__PACKAGE__->add_columns( "user_id", "role_id", ); __PACKAGE__->set_primary_key( "user_id", "role_id" );
__PACKAGE__->belongs_to( "user" => "K68::Db::K68::Users", { 'foreign.id' => 'self.user_id' } ); __PACKAGE__->belongs_to( "role" => "K68::Db::K68::Roles", { 'foreign.id' => 'self.role_id' } );
Now I want to delete one record from UserRole. I know $admin_role is 'fadm1', and user_id is 1. I did:
$c->model('K68::Roles')->search({role => $adm_role}) ->search_related('map_user_role',{user_id => $user_id})->delete;
But it create a sql :
DELETE FROM user_role WHERE ( ( ( user_id = '1' ) AND ( role = 'fadm1' ) ) )
so catalyst report an error : Unknown column 'role' in 'where clause'
If I do so: $c->model('K68::Roles')->search({role => $adm_role}) ->search_related('map_user_role',{user_id => $user_id})->first->delete;
it works.
I want to know: why first way didn't work?
thanks
0 Replies
|
|
|
[Dbix-class] RFC: Thoughts on a serialization format for Classes
By John Napiorkowski at Aug 1, 2007, 1:39 pm UTC
Hi, I am seriously considering writing a system to create DBIx Classes via a configuration file. Since the default for creating these classes are primarily package method calls I think this could be pretty easy. So we could replace: package myapp::Schema::foo __PACKAGE__->load_components( ... );... More...
Hi,
I am seriously considering writing a system to create DBIx Classes via a configuration file. Since the default for creating these classes are primarily package method calls I think this could be pretty easy.
So we could replace:
package myapp::Schema::foo
__PACKAGE__->load_components( ... ); __PACKAGE__table('foo');
(rest of your setup)
With (something like in evil YAML)
Schema: foo: table: foo load_components: - comp1 - comp2
and so forth.
We'd need an standard for package methods that can have multiply invocations, most the relationship stuff, but I think something like:
has_many: bars: myapp::Schema::bar foreign.id: self.barfk bats: myapp::Schema::bat foreign.id: self.batfk
The above is just a first guess as to how this could work. I'd use config::any or similar so that you can use the configuration of your choice. My imagination is telling me this could be a new method on Schema, that would be like ->load_classes, but would accept a Perl structure to auto create the classes.
So I was wondering what people thought of the idea, if you'd find it useful or am I off in my own world?
One objection I can see is that it makes it harder to add active record style methods, but you could always specify a custom result or resultclass to handle this.
Anyway, just my Sunday afternoon rumblings. Would appeciate thoughts and feedback from the group.
--John
____________________________________________________________________________________ Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase. http://farechase.yahoo.com/
8 Replies
|
|
|
[Dbix-class] [PATCH] Schema::Loader with reserved table name
By Tatsuhiko Miyagawa at Aug 1, 2007, 1:32 pm UTC
The following patch fixes some weird bugs when I used the table name 'show' with mysql. I'm not subscribed to the -devel mailing list. Forward this if needed. --- DBIx/Class/Schema/Loader/DBI.pm.old 2006-11-01 08:34:03.000000000 -0800 +++ DBIx/Class/Schema/Loader/DBI.pm 2007-07-31... More...
The following patch fixes some weird bugs when I used the table name 'show' with mysql.
I'm not subscribed to the -devel mailing list. Forward this if needed.
--- DBIx/Class/Schema/Loader/DBI.pm.old 2006-11-01 08:34:03.000000000 -0800 +++ DBIx/Class/Schema/Loader/DBI.pm 2007-07-31 06:29:30.000000000 -0700 @@ -91,7 +91,7 @@ $table = $self->{db_schema} . $self->{_namesep} . $table; }
- my $sth = $dbh->prepare("SELECT * FROM $table WHERE 1=0"); + my $sth = $dbh->prepare("SELECT * FROM " . $dbh->quote_identifier($table) . " WHERE 1=0"); $sth->execute; return \@{$sth->{NAME_lc}}; }
4 Replies
|
|
|
[Dbix-class] having attribute with count
By Les Fletcher at Aug 1, 2007, 10:01 am UTC
I am building up a result set and am see difference between the actual selection of the objects from the database and counting of those same objects. The query has a prefetch, groupby, having and a limit clause. What I am seeing is that when I request the objects from the database the query is... More...
I am building up a result set and am see difference between the actual selection of the objects from the database and counting of those same objects. The query has a prefetch, groupby, having and a limit clause. What I am seeing is that when I request the objects from the database the query is working just fine, but when I am doing a count, the having clause is dropped from the count query. In the source of resultset I see that the having attribute is deleted from time to time and then processed differently. Is there something that I can do to ensure that the having clause is used in the count? Thanks.
Les
The code is structured like this:
sub get_rs { # returns a result set ...->search( { ... }, { order_by => ... having => ... prefetch => ... order_by => ... } ); }
sub get_records { &get_rs->search( undef, { page => 1, rows => 10 } )->all; }
sub get_count { &get_rs->count; }
2 Replies
|
|
|
[Dbix-class] SQLite and empty INSERT statements...
By Jess Robinson at Jul 31, 2007, 10:46 pm UTC
Note sure if this is a bug/feature of SQL::Abstract or DBIC, but recording here for posterity and solution ideas: If I want to create a row with all default values, I can call ->create({}).. for SQLite, this produces: DBIx::Class::Schema::Journal::txn_do(): DBI Exception: DBD::SQLite::db... More...
Note sure if this is a bug/feature of SQL::Abstract or DBIC, but recording here for posterity and solution ideas:
If I want to create a row with all default values, I can call ->create({}).. for SQLite, this produces:
DBIx::Class::Schema::Journal::txn_do(): DBI Exception: DBD::SQLite::db prepare_cached failed: near ")": syntax error(1) at dbdimp.c line 269 [for Statement "INSERT INTO changeset () VALUES ()"] at t/01test.t line 33
looking at the SQLite bug database, I see: http://www.sqlite.org/cvstrac/tktview?tn=299
Which looks like we need to either produce: INSERT INTO table (<pk>) VALUES(NULL) (if there is a pk) or INSERT INTO table DEFAULT VALUES (it looks on the bug report as this will do the above, dunno what happens if there is no pk field.. )
Where should this munging go?
Jess
0 Replies
|
|
|
[Dbix-class] on_field_change DBIC hooks
By Pedro Melo at Jul 31, 2007, 8:42 pm UTC
Hi, I implementing a "on_field_change" hook. External classes can hook the DBIC model to observe (usually) status changes and start some business logic processes. The reason I choose this approach is that it creates a loosely coupled system, where I can add other components later without going back... More...
Hi,
I implementing a "on_field_change" hook. External classes can hook the DBIC model to observe (usually) status changes and start some business logic processes. The reason I choose this approach is that it creates a loosely coupled system, where I can add other components later without going back and modifying old code.
From my first look through the code, I think the set_column() is the proper place to do this. But we could set_column() and then not update ().
So update() and look at the dirty columns is probably safer.
If I want to trigger on insert also, I also have to watch for insert().
Another option is to create an InflateColumn::Trigger and use that, but it might not be what people expect.
Before I start coding, has anybody done this before? Suggestions?
Best regards,
5 Replies
|
|
|
[Dbix-class] Reconnecting Behavior
By Adam Herzog at Jul 30, 2007, 9:55 pm UTC
I'm having trouble with reconnecting to the db, and I'm not sure if it's expected behavior or not. Essentially, I have a cat/dbic app and mysql database. For reasons beyond my control, the mysql db is periodically shutdown for brief periods of time. If no requests are made during the downtime, then... More...
I'm having trouble with reconnecting to the db, and I'm not sure if it's expected behavior or not.
Essentially, I have a cat/dbic app and mysql database. For reasons beyond my control, the mysql db is periodically shutdown for brief periods of time. If no requests are made during the downtime, then the first request after the db becomes available again reconnects to the db and everything works great.
If a request comes in while the database is down, dbic tries to reconnect and fails (of course). But, further requests don't try and connect to the db anymore after the initial failure. So, once the database IS available again, dbic isn't reconnecting anymore, just failing (with "Can't call method "prepare_cached" on unblessed reference at /Library/Perl/5.8.6/DBIx/Class/Storage/DBI.pm line 1086.")
So... is this a bug, where dbic should be trying to reconnect after the initial failure? Or, is that expected behavior for some reason?
Any suggestions on what I can do, either to help update DBIC, or to handle the situation in my own code?
Thanks,
-A
9 Replies
|
|
|
[Dbix-class] Issue with DBIx::Class::ResultSet::find_or_create():
By Mesdaq, Ali at Jul 30, 2007, 5:22 pm UTC
This came up in the Catalyst list today so I am posting here for discussion or bug reporting. The issue is that it seems the find_or_create() call can have a hiccup in high load situations where find_or_create is called more than once at the same time with the same value. So what happens is both... More...
This came up in the Catalyst list today so I am posting here for discussion or bug reporting.
The issue is that it seems the find_or_create() call can have a hiccup in high load situations where find_or_create is called more than once at the same time with the same value. So what happens is both calls try to do a find and return nothing then they attempt to insert and once succeeds and one gets an error of:
DBIx::Class::ResultSet::find_or_create(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry
The code for find_or_create is
sub find_or_create { my $self =3D shift; my $attrs =3D (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}); my $hash =3D ref $_[0] eq 'HASH' ? shift : {@_}; my $exists =3D $self->find($hash, $attrs); return defined $exists ? $exists : $self->create($hash); }
I started to dig into the source to show where you guys can handle this but with so much abstraction and 10 modules later I realized its probably best if I just let you guys decide how to handle it. But we have had this issue ourselves with a in-house db abstraction layer. The way the developers handled it and I think the way you guys should as well is by wrapping find_or_create with a exception handler for DBD::mysql::st execute failed: Duplicate entry which if triggered makes it run the find function again. So it would look something like this assuming you put some flags in to handle that exception at the lower levels like DBIx::Class::Storage, DBIx::Class::Storage::DBI:: . Of course its not tested code just an example I don't know how this affects other storage engines and other implications.
sub find_or_create { my $self =3D shift; my $attrs =3D (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}); my $hash =3D ref $_[0] eq 'HASH' ? shift : {@_}; my $exists =3D $self->find($hash, $attrs); if (!$exists) { # Assuming -1 is returned specifically on Duplicate Key Inserts my $id =3D $self->create($hash); if ($id =3D=3D -1) { # Reselects and returns ID since it must have been created after the first find and before the create return $self->find($hash, $attrs); } else { # Returns the ID since the create worked fine return $id; } } else { return $exists; } }
Let me know if you guys need more clarification on this because I think it's a bug. By the way DBIx::Class is pretty much everything I wanted in a DB abstraction layer. I love it!
Thanks, ------------------------------------------ Ali Mesdaq Security Researcher II Websense Security Labs http://www.WebsenseSecurityLabs.com ------------------------------------------
5 Replies
|
|
|
[Dbix-class] Insert using a result set with 'where' produces weird result
By Ivan Fomichev at Jul 30, 2007, 09:40 am UTC
Hello, I've got a weird result when trying to insert a row using a result set with 'where'. Here's a sample code: 8<--------------------------ifomichev_test.sql----------------------------- DROP TABLE IF EXISTS `records`; CREATE TABLE `records` ( `record_id` int(10) unsigned NOT NULL... More...
Hello,
I've got a weird result when trying to insert a row using a result set with 'where'. Here's a sample code:
8<--------------------------ifomichev_test.sql----------------------------- DROP TABLE IF EXISTS `records`; CREATE TABLE `records` ( `record_id` int(10) unsigned NOT NULL auto_increment, `value` varchar(255) default NULL, PRIMARY KEY (`record_id`) );
INSERT INTO `records` VALUES (1,'baba'),(2,'dada'),(3,'kaka'),(4,NULL); 8<-------------------------------Schema.pm--------------------------------- package Schema;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_classes();
1; 8<---------------------------Schema/Record.pm------------------------------ package Schema::Record;
use base qw/DBIx::Class/;
__PACKAGE__->load_components( qw/ Core PK::Auto / ); __PACKAGE__->table( 'records' ); __PACKAGE__->add_columns( qw/ record_id value / ); __PACKAGE__->set_primary_key( qw/ record_id / );
1; 8<-----------------------------test_dbic.pl-------------------------------- #!/usr/bin/perl use strict; use warnings;
use Schema;
my $schema = Schema->connect( 'DBI:mysql:ifomichev_test', 'root' ); $schema->storage()->debug( 1 );
my $rs = $schema->resultset('Record')->search( { value => { '!=' => undef } }, );
$rs->create( { value => 'papa' } ); #$rs->result_source()->resultset()->create( { value => 'papa' } ); 8<----------------------------------END------------------------------------
Result:
8<----------------------------CURRENT RESULT------------------------------- INSERT INTO records (value) VALUES (?): 'HASH(0xa3d50cc)' 8<----------------------------------END------------------------------------
'HASH(0xa3d50cc)' appears because a new result is being created with 'value' equal to a structure passed to search method ( { '!=' => undef } ), though I would expect 'value' be overriden with what I passed to the create method (i. e., 'papa'). I worked this around with taking a result source from the result set and then making a new result set (see a commented line above):
8<----------------------------EXPECTED RESULT------------------------------ INSERT INTO records (value) VALUES (?): 'papa' 8<----------------------------------END------------------------------------
Regards, Ivan
0 Replies
|
|
|
Re: [Dbix-class] SQL::Translator 0.08 Unique/Index clash problem
By Jon Schutz at Jul 30, 2007, 08:58 am UTC
This original post was on the DBIx::Class list, copying now to SQLFairy- developers with patch... Time passes, and I find I'm looking at the same problem again. Having dug deeper, SQL::Translator::Producer::MySQL in 0.07 added an INDEX declaration for every FOREIGN_KEY constraint. In 0.08, that bit... More...
This original post was on the DBIx::Class list, copying now to SQLFairy- developers with patch...
On Wed, 2007-01-31 at 14:36 +1030, Jon Schutz wrote: > With SQL::Translator 0.07, a DBIx::Class declaration such as this: > > __PACKAGE__->add_columns('plugin_id' => { > 'data_type' => 'integer', > 'is_nullable' => 0, > 'is_auto_increment' => 1, > }, > 'class' => { > 'data_type' => 'varchar', > 'size' => 100, > 'is_nullable' => 0, > 'is_auto_increment' => 0, > }, > ); > __PACKAGE__->set_primary_key('plugin_id'); > __PACKAGE__->add_unique_constraint('class' => [ 'class' ]); > > would result in SQL that looks like this: > > plugin_id integer NOT NULL auto_increment, > class varchar(100) NOT NULL, > PRIMARY KEY (plugin_id), > UNIQUE (class) > > and life was good. After upgrading to SQL::Translator 0.08, I get: > > `plugin_id` integer NOT NULL auto_increment, > `class` varchar(100) NOT NULL, > INDEX (`plugin_id`), > INDEX (`class`), > PRIMARY KEY (`plugin_id`), > UNIQUE `class` (`class`) > > which results in the error: > > Duplicate key name 'class' at /usr/lib/perl5/site_perl/5.8.8/DBIx/Class/Storage/DBI.pm line 1120. > > If I change the name of the key to class_xx, I get > > `plugin_id` integer NOT NULL auto_increment, > `class` varchar(100) NOT NULL, > INDEX (`plugin_id`), > INDEX (`class`), > PRIMARY KEY (`plugin_id`), > UNIQUE `class_xx` (`class`) > > which is gets around the error but is wasteful of MySQL resources. > > It seems to me that the old version got it right, and the new one is > wrong. > > I have the same problem whether using SQL::Translator directly or using > the 'deploy' method. > > I don't really know whether its a problem with SQL::Translator or the > way DBIx::Class uses it, so here I am appealing to the wisdom of the > list. > > Other than downgrading to 0.07, is anyone aware of a fix for this? >
Time passes, and I find I'm looking at the same problem again.
Having dug deeper, SQL::Translator::Producer::MySQL in 0.07 added an INDEX declaration for every FOREIGN_KEY constraint. In 0.08, that bit of code moved so that it now adds an INDEX declaration for every constraint type unless an index has already been defined.
The valid types of constraint are PRIMARY_KEY, UNIQUE, CHECK_C, FOREIGN_KEY, NOT_NULL.
I humbly suggest that there is no reason to add an index except in the FOREIGN_KEY case. PRIMARY_KEY and UNIQUE implicitly have an index anyway, CHECK_C is used in Oracle/Postgres/DB2 - not quite sure what it does but my guess is it refers so some stored procedure for validation so doesn't require an indexed lookup - and NOT_NULL likewise doesn't need an indexed lookup.
Thus I propose that that little bit of code only be invoked on FOREIGN_KEY types, per patch (source & test) attached.
Jess, if it looks OK to you, could you please put this where it needs to be?
Thanks,
0 Replies
|
|
|
[Dbix-class] abstract syntax (extract from a conversation)
By Matt S Trout at Jul 27, 2007, 05:03 am UTC
This is the most coherent message to show the lines along which we were thinking (hdp is confound on #dbix-class). Those of you who don't have context for this, poke the list archives. Those of you who do, please bear in mind when responding what anything involving the creation of assloads of... More...
This is the most coherent message to show the lines along which we were thinking (hdp is confound on #dbix-class).
Those of you who don't have context for this, poke the list archives.
Those of you who do, please bear in mind when responding what anything involving the creation of assloads of objects will be laughed at and/or ignored since the intention is SQL::Abstract-level performance.
On Thu, Jun 28, 2007 at 09:38:58PM -0400, Hans Dieter Pearcey wrote: > Here are some very preliminary thoughts. Like I said, I'm fried from YAPC, so > who knows how useful this will be. > > * 2-pass system: > * DWIM AST -> explicit AST > * explicit AST -> backend > * lol-only AST means no key collisions, complete control over ordering > > >>> { foo => 1 } > > [ -statement, > [ -key => 'foo' ], > [ -op => 'is' ], > [ -value => 1, > ]
[ -op, 'is', [ -ident, 'foo' ], [ -value, \1 ] ]
(values should always be a ref so we can change 'em easily later) > >>> { foo => 1, bar => { '!=' => 2 } } > > [ -cond => 'and', > [ -statement, ... ] > [ -statement, > [ -key => 'bar' ], > [ -op => 'is_not' ], > [ -value => 2 ], > ], > ]
[ -op, 'and', [ -op, 'is', ... ], [ -op, '!is', ... ] ]
(I think the ! will be easier to parse)
> alternately, if we don't want 'not' ops, > > [ -cond => 'and', > [ -statement, ... ] > [ -cond => 'not', > [ -statement, > [ -key => 'bar' ], > [ -op => 'is' ], > [ -value => 2 ], > ], > ], > ] > >>> [ foo => 1, baz => [ 3, 4 ] ] > > [ -cond => 'or', > [ -statement, ... ] > [ -cond => 'or', > [ -statement, > [ -key => 'baz' ], > [ -op => 'is' ], > [ -value => 3 ], > ], > [ -statement, > [ -key => 'baz' ], > [ -op => 'is' ], > [ -value => 4 ], > ], > ], > ] > > >>> [ foo => 1, baz => { -in => [ 3, 4 ] } ] > > [ -cond => 'or', > [ -statement, ... ] > [ -cond => 'or', > [ -statement, > [ -key => 'baz' ], > [ -op => 'in' ], > [ -value => [ 3, 4 ] ], > ], > ], > ]
I think the value should be an explicit list, so
[ -op, 'in', [ -ident ... ], [ -list, [ -value, \3 ], [ -value, \4 ] ] ] > special things: -statement, -cond, -key, -op, -value > > a statement is a key, an op, and a value.
No, because the RHS could be an identifier.
Ops - maybe we should explicitly do -binop but really we should always given them arity. maybe -op1, -op2, -op_list ?
> notes: > * I don't really like '-statement'. is there a better name?
I don't see a need for it. -op, -list, -ident, -value, -func should be enough, no?
> * Is the leading '-' actually useful for anything? visual marking?
Lack of quoting requirement.
> * do statements need to be lols, or could they be hashrefs? might a statement > ever have two keys? I can't imagine how -- I would expect it to decompose into > two statements.
Sod hashrefs, they only lead to annoyance.
> * what ops do we need? is, regexp... isa? like could be sugar for regexp. > * where does per-backend stuff go?
Its own class, delegated to as appropriate, I think.
> do we need -op => { sql => 'in', ldap => ... } ? > * where is extensibility most important and how do we add it? > * new op types > * anywhere else?
I think we'll find that out by implementing.
5 Replies
|
|
|
[Dbix-class] repo re-org
By Matt S Trout at Jul 27, 2007, 12:57 am UTC
DBIC is now based off http://dev.catalyst.perl.org/repost/bast/DBIx-Class 0.08/trunk is the old trunk, 0.09/trunk is the replacement for -current both have branches dirs. I'll sort out tags when we cut a release. More...
DBIC is now based off
http://dev.catalyst.perl.org/repost/bast/DBIx-Class
0.08/trunk is the old trunk, 0.09/trunk is the replacement for -current
both have branches dirs.
I'll sort out tags when we cut a release.
1 Reply
|
|
|
[Dbix-class] Prefetch not supported with accessor 'multi'
By Ramprabhu Kaliaperumal at Jul 26, 2007, 8:21 pm UTC
Hi All I am getting this error Caught exception in GlobalDC::C::Host->list "DBIx::Class::ResultSet::all(): Prefetch not supported with accessor 'multi' at /globaldc/web/dev11/catalyst/lib/GlobalDC/C/Host.pm line 173" Here is my code my @hosts = $c->model('Local::Host')->search( { -and =>... More...
Hi All I am getting this error
Caught exception in GlobalDC::C::Host->list "DBIx::Class::ResultSet::all(): Prefetch not supported with accessor 'multi' at /globaldc/web/dev11/catalyst/lib/GlobalDC/C/Host.pm line 173"
Here is my code
my @hosts = $c->model('Local::Host')->search( { -and => [{'problems.status' => ['error', 'warning']}, @search] }, {join => [qw/ problems /], select => ['me.hostname','me.ip','me.console','me.escalation_group','problems.status'], distinct => 1, order_by => 'hostname', cache => 1})->all;
I am able to understand the error message.. Please help!
Regards -Ram
1 Reply
|
|
|
[Dbix-class] modifying join condition in search
By Pedro Melo at Jul 25, 2007, 2:19 pm UTC
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 statement to the join condition. If I use join =>... More...
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 statement to the join condition.
If I use join => 'watchers',
the SQL generated is:
ph_topics me LEFT JOIN ph_watchers watchers ON ( watchers.topic_id = me.id )
but I need it to be like this:
ph_topics me LEFT JOIN ph_watchers watchers ON ( watchers.topic_id = me.id AND watchers.user_id = 5 )
(where 5 wlll be a parameter).
Before I jump to the 'from' attribute, can this be done with join? I could not figure it out...
Best regards,
5 Replies
|
|
|
[Dbix-class] ANNOUNCE - Language::MuldisD, Muldis::DB v0.3.0 released
By Darren Duncan at Jul 24, 2007, 11:51 pm UTC
All, Since last week, I went ahead and separated, into its own GIT repository and distribution series, the collection of pod-only files that comprise the Muldis D language specification; from now on, to see the development of the language spec itself, go to:... More...
All,
Since last week, I went ahead and separated, into its own GIT repository and distribution series, the collection of pod-only files that comprise the Muldis D language specification; from now on, to see the development of the language spec itself, go to:
http://search.cpan.org/dist/Language-MuldisD/
... and to see my main Perl 5 implementation of that language, Muldis DB, you still go to:
http://search.cpan.org/dist/Muldis-DB/
... as you did before.
Today I have released distros of the versions 0.3.0 of both projects on CPAN (then followed by a 0.3.1 for the language spec to fix a big CPAN indexing bug), and these are visible now.
There weren't any non-minor updates besides the split, since 0.2.0.
Note that the split was done in a relatively rough manner, and the parts will stand to get cleaned up in the near future.
In the future, there may very well be a good 4 separate implementations or manifestations of the language (by contrast, there are 2 right now), so it makes more and more sense for the spec to be separate from each of them, and for it to be updated and published on separate schedules, such as the Perl 6 Synopsis and the Pugs and Parrot et al projects are separate.
Thank you. -- Darren Duncan
0 Replies
|
|
 | |