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:
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;
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
$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
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} || {}});
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
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
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
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
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
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
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
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 =
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'
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
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
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
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
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
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{$_}}
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
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
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
!
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
use Catalyst qw/
...
Authentication
Authentication::Credential::HTTP
Authorization::Roles
...
/;
...
realms = {
default = {
store = {
class = 'DBIx::Class',
::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
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
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
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
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:
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,
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
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,
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:
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:
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:
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
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 (
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
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
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. :(
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:
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:
43 matches
Mail list logo