Re: [Dbix-class] Excluding columns from a query

2010-02-28 Thread Oleg Pronin
and BYTEA 2010/2/24 Dan Horne dan.ho...@redbone.co.nz: If coltype == TEXT | BLOB | NTEXT don't select it And CLOB, please ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN:

Re: [Dbix-class] RFC: DBICx::Shortcuts

2010-02-05 Thread Oleg Pronin
IMHO you are doing the right thing, but i can advice you a futher improvement and very important - perfomance boost for your module. You can do shorcuts shorter: in setup_finalize of Catalyst: foreach my $source ($schema-sources) { next unless index($source, '::') == -1;

[Dbix-class] Cross-schema relationships.

2010-02-01 Thread Oleg Pronin
Hi everyone. I'm separating a part of database tables to second database server. Therefore i created second schema and put a part of result sources in there. I discovered that cross-schema relationships doesn't work: i get error DBIx::Class::ResultSource::related_source(): Can't find source for

Re: [Dbix-class] Cross-schema relationships.

2010-02-01 Thread Oleg Pronin
$messageRS-search({...}, { prefetch = 'user' }) then it is wrong, and i'll get database level error. Just a part of functionality could be supported. 2010/2/1 Rob Kinyon rob.kin...@gmail.com: On Mon, Feb 1, 2010 at 11:52, Oleg Pronin syber@gmail.com wrote: Hi everyone. I'm separating

[Dbix-class] BUG IN DBIx::Class::Row::insert

2009-10-05 Thread Oleg Pronin
There is a bug in DBIx::Class::Row::insert with strating a transaction every time i insert object with inflated column, for example DateTime. 285: my %related_stuff = (%{$self-{_relationship_data} || {}}, 286: %{$self-{_inflated_column} || {}});

Re: [Dbix-class] Bug in Catalyst::Model::DBIC::Schema ?

2009-09-02 Thread Oleg Pronin
this? On Wed, Aug 26, 2009 at 10:43:22PM +0400, Oleg Pronin wrote: Hello. I've just upgraded to last cat dbic related and i get error with my model. I use custom DBI class for my DB connection persistence package Myapp::Model::General; use parent 'Catalyst::Model::DBIC::Schema'; use strict; use

[Dbix-class] Bug in Catalyst::Model::DBIC::Schema ?

2009-08-26 Thread Oleg Pronin
Hello. I've just upgraded to last cat dbic related and i get error with my model. I use custom DBI class for my DB connection persistence package Myapp::Model::General; use parent 'Catalyst::Model::DBIC::Schema'; use strict; use DBIx::RetryOverDisconnects; __PACKAGE__-config( schema_class

[Dbix-class] possible bug in DBIx::Class::Row

2009-05-13 Thread Oleg Pronin
in DBIx::Class::Row::insert if(!$self-{_rel_in_storage}) { #heavy code } #insert code Example: $obj1 = $rs-new({...}); $obj2 = $obj1-new_related('abc', {..}); $obj1-insert; #ok #this cause 'heavy code' to execute because $self-{_rel_in_storage} is undefined although $obj1 has been

[Dbix-class] Row object does not work correctly after thaw.

2009-05-08 Thread Oleg Pronin
Hello. DBIx::Class::ResultSourceHandle has storable hooks to correctly store row object and restore it. However after restore, trying to update such an object will fail: Can't call method update on an undefined value at /usr/local/lib/perl5/site_perl/5.10.0/DBIx/Class/Row.pm line 490. Because

Re: [Dbix-class] Row object does not work correctly after thaw.

2009-05-08 Thread Oleg Pronin
Berlin ash_c...@firemirror.com On 8 May 2009, at 10:09, Oleg Pronin wrote: Hello. DBIx::Class::ResultSourceHandle has storable hooks to correctly store row object and restore it. However after restore, trying to update such an object will fail: Can't call method update on an undefined value

Re: [Dbix-class] RE: Inheritance question..

2009-01-22 Thread Oleg Pronin
the relationships correct to my other objects. -- *From:* Oleg Pronin [mailto:syber@gmail.com] *Sent:* 22 January 2009 01:40 *To:* DBIx::Class user and developer list *Subject:* Re: [Dbix-class] RE: Inheritance question.. 1) DBIx::Class::DynamicSubclass

Re: [Dbix-class] Bug in DBIx::Class::ResultSource::remove_columns ?

2009-01-21 Thread Oleg Pronin
thanks! 2009/1/21 Peter Rabbitson rabbit+d...@rabbit.us rabbit%2bd...@rabbit.us Oleg Pronin wrote: unixdiff for DBIx-Class-0.08099_05 attached 2009/1/16 Ash Berlin ash_c...@firemirror.com mailto:ash_c...@firemirror.com On 16 Jan 2009, at 16:35, Oleg Pronin wrote

Re: [Dbix-class] RE: Inheritance question..

2009-01-21 Thread Oleg Pronin
1) DBIx::Class::DynamicSubclass will automaticaly subclass your row object when a) fetched from DB b) created (-new or -create) c) changed subclassing column For example when type = null row is BaseClass, when type = 1 row is ClassA, when 2 row is ClassB. my $row =

Re: [Dbix-class] join problem ( change alias for table )

2009-01-20 Thread Oleg Pronin
The best way is to use quote_char In your MyDB.pm Model: __PACKAGE__-config( schema_class = ... connect_info = [ ..., { quote_char = q{}, name_sep = q{.}, }, ], ); But you will still in trouble when writing order_by = 'user DESC'

Re: [Dbix-class] join problem ( change alias for table )

2009-01-20 Thread Oleg Pronin
that depends on what u mean 2009/1/20 Howe, Tom (IDEAS PRACTICE AREAS) tom.h...@morganstanley.com Are there any good examples of modelling inheritance with DBIx::Class? Thanks, -- *From:* Oleg Pronin [mailto:syber@gmail.com] *Sent:* 20 January 2009 15:11

Re: [Dbix-class] Bug in DBIx::Class::ResultSource::remove_columns ?

2009-01-16 Thread Oleg Pronin
The patch does not change the functionality of 'remove_columns', just bugfix, so i suppose no additional tests are required, are they? 2009/1/16 Peter Rabbitson rabbit+l...@rabbit.us rabbit%2bl...@rabbit.us Oleg Pronin wrote: Maybe i misunderstood something but i suppose there is a bug

Re: [Dbix-class] Bug in DBIx::Class::ResultSource::remove_columns ?

2009-01-16 Thread Oleg Pronin
unixdiff for DBIx-Class-0.08099_05 attached 2009/1/16 Ash Berlin ash_c...@firemirror.com On 16 Jan 2009, at 16:35, Oleg Pronin wrote: The patch does not change the functionality of 'remove_columns', just bugfix, so i suppose no additional tests are required, are they? [snip

Re: [Dbix-class] Problem using DBIx::Class::ResultClass::HashRefInflator

2009-01-12 Thread Oleg Pronin
It will be much faster in your test if you write something like this: my $resultset = $schema-resultset(...)-search(...); $resultset-result_class('DBIx::Class::ResultClass::HashRefInflator'); sub dbic_HashRefInflator { my @req = $resultset-all; } Because the creation of new resultset (on

[Dbix-class] Bug in DBIx::Class::ResultSource::remove_columns ?

2009-01-12 Thread Oleg Pronin
Maybe i misunderstood something but i suppose there is a bug in remove_columns. DB14 x $this-columns 0 'id' ... 16 'logo_small' 17 'logo_mid' 18 'logo_full' 19 'screenshots' 20 'data' 21 'logo' $this-remove_column($c); # $c = 'logo'; DB15 x $this-columns 0 'id' ... 16

[Dbix-class] Re: Bug in DBIx::Class::ResultSource::remove_columns ?

2009-01-12 Thread Oleg Pronin
oops sorry, mistake. sub remove_columns { my ($self, @to_remove) = @_; return unless my $ordered = $self-_ordered_columns; my $columns = $self-_columns; delete $columns-{$_} for @to_remove; my %to_remove = map {$_ = 1} @to_remove; $self-_ordered_columns([grep {!$to_remove{$_}}

Re: [Dbix-class] Race condition in find_or_create()

2008-07-31 Thread Oleg Pronin
Not quite right. There are two general case: 1) when you except most of queries to not find the row. Then your example is quite ok. eval {create}; if error then find; Most of cases there will be only 1 query. 2) when you expect to find (for example - updating daily stats once per

Re: [Dbix-class] Race condition in find_or_create()

2008-07-31 Thread Oleg Pronin
Do not forget that not all of the world has english databases. Some people use localized postgresql or other. If so it may return errors in other language :) The best way is to use error codes (they are specific in various db servers), but unfortunately, some databases (or database drivers) return

Re: REPOST: [Dbix-class] DBIx::Class and caching

2008-07-20 Thread Oleg Pronin
First that comes in my mind is that 'single' does not accept attributes. But caching in 'single' is often needed. Doing $rs-search(...)-single() is not pretty 2008/7/20 Matt S Trout [EMAIL PROTECTED]: On Thu, Jul 17, 2008 at 07:18:08PM +0400, Oleg Pronin wrote: 2008/7/16 Hartmaier Alexander

Re: REPOST: [Dbix-class] DBIx::Class and caching

2008-07-17 Thread Oleg Pronin
! maybe, (if i will understand how to make it more convenient for configuring) -Alex *From:* Oleg Pronin [mailto:[EMAIL PROTECTED] *Sent:* Thursday, July 03, 2008 4:19 PM *To:* dbix-class@lists.scsys.co.uk *Subject:* REPOST: [Dbix-class] DBIx::Class and caching

[Dbix-class] C::Authentication::Store::DBIx::Class 'id_field' not working ?

2008-07-14 Thread Oleg Pronin
use Catalyst qw/ ... Authentication Authentication::Credential::HTTP Authorization::Roles ... /; ... realms = { default = { store = { class = 'DBIx::Class',

Re: [Dbix-class] DBIx::Class and caching

2008-07-03 Thread Oleg Pronin
::Class::Cursor::Cached but replacing the cache engine Cache::FileCache with Memcache? I will try it out and let you know the results, but if someone else has already tried it would be nice to know what their findings were Andreas --- On Wed, 6/25/08, Oleg Pronin [EMAIL PROTECTED] wrote

Re: [Dbix-class] DBIx::Class and caching

2008-07-03 Thread Oleg Pronin
Of course when your project is not popular or you never run benchmark on what you write, you have no matter. I have 5-7mln page hits per day. When i tried to use DBIC::Cursor::Cached, users were about to blow the server up. 2008/7/3 Tobias Kremer [EMAIL PROTECTED]: Quoting Andreas Pronakis

Re: [Dbix-class] DBIx::Class and caching

2008-07-03 Thread Oleg Pronin
I didn't want to affend you, sorry. But but then I'd argue that you shouldn't be doing that anyway. i dont agree. This is a great technic in many cases. And no it doesn't have to construct a row object if you don't want to See

Re: [Dbix-class] DBIx::Class and caching

2008-06-25 Thread Oleg Pronin
This is how i cache resultset search results in memcache: There 2 modules in attach. 1) To use memcaching for some object you need to set ResultSetMemcached as its resultset class (or resultset which derives from it). 2) Code in ResultSource.pm must be in your base resultsource class. 3) You

Re: [Dbix-class] DBIx::Class and caching

2008-06-25 Thread Oleg Pronin
These approach caches ready objects, not just a data from database, so it quite fast, and lets you to cache any data with object, even not from DB. ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN:

Re: [Dbix-class] DBIx::Class subclass and multiple tables

2008-06-25 Thread Oleg Pronin
In such cases i use this tactics: 1) store all the data in single table using DBIx::Class::FrozenColumns (it allows you to store dynamic number of column in one BLOB column) and these columns will be for you just if they were normal columns (i.e. $obj-some_frozen_column,

Re: [Dbix-class] discard_changes upgrade.

2008-04-11 Thread Oleg Pronin
Yeah, that would be great! something like 'reload' or 'refresh'. Should we post a patch for code and test, or somebody else will do this? 2008/4/10, Matt S Trout [EMAIL PROTECTED]: On Tue, Mar 25, 2008 at 11:54:24AM +0300, Oleg Pronin wrote: Hello. I think 'discard_changes' should

Re: [Dbix-class] perl 5.10.0 and Class::Accessor::Grouped

2007-12-26 Thread Oleg Pronin
It wouldn't help for other thousands of modules on CPAN and millions of applications that use [EMAIL PROTECTED] :( 2007/12/26, Christopher H. Laco [EMAIL PROTECTED]: Now that this has been declared as a bug in 5.10.0 (http://perlmonks.com/?node_id=658998), and unless mst has any objections,

Re: [Dbix-class] perl 5.10.0 and Class::Accessor::Grouped

2007-12-23 Thread Oleg Pronin
tomorrow i'll test whether the problem exists on fedora linux. ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive:

Re: [Dbix-class] perl 5.10.0 and Class::Accessor::Grouped

2007-12-21 Thread Oleg Pronin
Scalar::Util v1.19 and it IS a compiled version. ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive:

Re: [Dbix-class] perl 5.10.0 and Class::Accessor::Grouped

2007-12-21 Thread Oleg Pronin
This code: no strict 'refs'; return ${$self.'::__cag_'.$set} = $val; executes on 510 slightly slower than on 5.8 but not so much to bring significant perfomance penalties. ___ List:

Re: [Dbix-class] perl 5.10.0 and Class::Accessor::Grouped

2007-12-21 Thread Oleg Pronin
Yes, sorry, but this doesn't change the matter. The result is that get_linear_isa runs 10x faster on 5.10.0 while C::A::G runs up to 25% slower on 5.10.0 and therefore the root of the problem is still somewhere in C::A::G. 2007/12/21, Aaron Crane [EMAIL PROTECTED]: Oleg Pronin writes

Re: [Dbix-class] perl 5.10.0 and Class::Accessor::Grouped

2007-12-20 Thread Oleg Pronin
The problem seems to be in C::A::G. [EMAIL PROTECTED] /home/syber =./operl58/bin/perl test/mro_test58.plx Benchmark: running aa, bb, cc, dd, ee for at least 1 CPU seconds... aa: 1 wallclock secs ( 1.10 usr + 0.00 sys = 1.10 CPU) @ 235174.13/s (n=259059) bb: 1 wallclock secs (

Re: [Dbix-class] lost connection during query

2007-10-31 Thread Oleg Pronin
you may wish to see DBIx::RetryOverDisconnects to forget about this problem. 2007/10/31, J. G. Konrad [EMAIL PROTECTED]: I was wondering if anyone had experience with this type of error, DBI Exception: DBD::mysql::st execute failed: Lost connection to MySQL server during query while using

Re: [Dbix-class] lost connection during query

2007-10-31 Thread Oleg Pronin
2007/10/31, Brandon Black [EMAIL PROTECTED]: The logic behind the only reconnect+retry once per statement/txn idea is that we want to protect from things like disconnects due to idle sessions or rebooted servers, but we don't want to retry indefinitely if we keep getting disconnected (because

[Dbix-class] DEV: DBIx::RetryOverDisconnects

2007-10-18 Thread Oleg Pronin
For DBIC developers: please look at this module on cpan. It is beta and i suppose there are bugs and only pg mysql sqlite is supported for now. But a part of the code in storage would not be needed if this DBI is used in the future. What do you think? p.s. POD is in bad english, sorry. :(

Re: [Dbix-class] How to write this condition in DBIC?

2007-10-12 Thread Oleg Pronin
my $cond = lower(field)=$value; $rs-search({}, { where = \$cond }); Thanks for help, i'm an idiot :) There will be an SQL-injection bug in this example, isn't that right? I.e. $value has to be quoted manually ? ___ List:

[Dbix-class] How to write this condition in DBIC?

2007-10-12 Thread Oleg Pronin
SELECT * FROM table WHERE lower(field) = ? ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: