Re: [Dbix-class] some answers about the benchmarks

2012-07-08 Thread Eden Cardim
::Doc::Design Dami> ), do some experiments, and find out by yourself. Or you can ask someone on the list or in the support channel for help and they'll point you to ways of achieving similar speeds to the ones posted in the benchmark code,

Re: [Dbix-class] (no subject)

2012-07-08 Thread Eden Cardim
n the first place, so what's the point? If that is the only use case in your software, then by all means do *not* use DBIC. Most useful applications, however, require much more structure than what a simple join offers. -- Eden Cardim +55 11 9644 8225 Shadowcat Systems Ltd.

Re: [Dbix-class] (no subject)

2012-07-02 Thread Eden Cardim
pproach is generally not recommended because it adds several maintainance complexities which make it inviable for use in industrial scale applications (which generally evolve spontaneously from "simple" applications). It might be worth mentioning that DBIC also suppo

Re: [Dbix-class] how to avoid adding duplicate row to table containing unique field/column

2011-10-15 Thread Eden Cardim
had> database. This will also help avoid tests failing Fahad> intermittently. See Test::DBIx::Class for an automated way to do this. -- Eden Cardim Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deploym

Re: [Dbix-class] object as a value of result_class (resultset_class)

2011-09-25 Thread Eden Cardim
Neil's suggestions? I don't argue. Just give me the Roman> 2 lines of code clue about resultset processors. You've been pointed to kiokudb twice, and I've detailed Neil's other suggestion in this message and the previous one. To summarize, your model is botched and

Re: [Dbix-class] object as a value of result_class (resultset_class)

2011-09-24 Thread Eden Cardim
g classes magically behind the scenes. You can of course, abstract the objects and not make any assumptions about the specific classes of the objects you're working with, but then what's the benefit of reblessing? You're better off by creating three tables, a person table, and w

Re: [Dbix-class] object as a value of result_class (resultset_class)

2011-09-20 Thread Eden Cardim
en now but a warning is issued by Roman> Class::Inspector) Roman> I appreciate any comment https://metacpan.org/module/DBIx::Class::KiokuDB does exactly what you're trying to implement. -- Eden Cardim Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowc

Re: [Dbix-class] using as normal perl module

2011-07-29 Thread Eden Cardim
isn't really the best you can get in performance. -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://blog.edencard

Re: [Dbix-class] How can the cookbook Data::Dumper recipe possibly work?

2011-07-20 Thread Eden Cardim
ment $_[0] is | updated, the corresponding argument is updated ` This means that assigning to $_[0] modifies the scalar within the caller scope. It's done that way so you get a new object in the Data::Dumper scope without stomping your original object. -- Eden Cardim Need help

Re: [Dbix-class] Feature request: complex join

2011-07-04 Thread Eden Cardim
8190_01/lib/DBIx/Class/Relationship/Base.pm Although I'm not sure what the current state of that feature is. Also, why don't you just normalize your emails field into a table so you can benefit from the vanilla joins available in DBIC? -- Eden Cardim Need help wit

Re: [Dbix-class] Extracting ORDER BY clause

2011-07-04 Thread Eden Cardim
7;s bad idea). What's a "complex order by"? Can you provide code examples using both DBIC, and the equivalent SQL you're expecting to obtain? -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/ca

Re: [Dbix-class] Caching solutions for DBIx::Class

2011-07-03 Thread Eden Cardim
>>>>> "Alex" == Alex Povolotsky writes: Alex> Good; how can I set default cache_time for all searches Alex> without explicit cache_time? Have a look at the resultset_attributes method in DBIx::Class::ResultSource. -- Eden Cardim Need help wi

Re: [Dbix-class] Per the design of a method

2011-06-20 Thread Eden Cardim
dorian> multiples "uses multiples"? what do you mean? dorian> unless I do something like set the offset to $x and collect dorian> as many pages as $x*$y >= $z, but that is dumb. Huh? dorian> Did I miss something? Yes, the actual requirement with a use-case and sampl

Re: [Dbix-class] any factual comparisons of Oracle, PostgreSQL, MySQL ?

2011-04-20 Thread Eden Cardim
a lot of other languages) for Kaare> functions. No-brainer here I think. Yes, I'd very much like all of the software components I'm using to do as much work as possible for me, that way I can deliver early. -- Eden Cardim Need help with your Catalyst or DBIx::Class projec

Re: Fwd: Re: Re: [Dbix-class] any factual comparisons of Oracle, PostgreSQL, MySQL ?

2011-04-15 Thread Eden Cardim
e mysql warns you of absolutely nothing is when an integer overflow occurs, I've lost one too many hours of my life and sanity debugging those cases. -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/cat

Re: [Dbix-class] Re: question about connect from manual

2011-02-24 Thread Eden Cardim
to the $schema object, it'll be connected, you don't have to connect once for every query. -- Eden Cardim Software Engineer Shadowcat Systems Ltd. http://www.shadowcat.co.uk http://blog.edencardim.com ___ List: http://lists.scsys.co

Re: [Dbix-class] Filtering a SELECT based on a calculation of two columns?

2011-02-22 Thread Eden Cardim
n example. Does --8<---cut here---start->8--- $rs->search(\[ 'YEAR(date_of_birth) < ?', $year ]); --8<---cut here---end--->8--- work for you? Chris> The SQL::Abstract documen

Re: [Dbix-class] question about connect from manual

2011-02-20 Thread Eden Cardim
] my $schema = My::Schema->autoconnect; --8<---cut here---end--->8--- solve the problem for you? I'd still recommend the former aproach. -- Eden Cardim Software Engineer Shadowcat Systems Ltd. http://www.shadowcat.co.uk http://blog.edencardim.com

Re: [Dbix-class] potential convert from rose::db

2011-02-09 Thread Eden Cardim
mst-signed advertisement). There are plenty of ways to optimize the raw DBIC methods/accessors. -- Eden Cardim Software Engineer Shadowcat Systems Ltd. http://www.shadowcat.co.uk http://blog.edencardim.com ___ List: http://lists.scsys.co.uk/cgi-bin/mai

Re: [Dbix-class] Best practice for case-insensitive searches

2011-01-26 Thread Eden Cardim
thought-provoking impulse advise is much appreciated. $rs->search({ 'LOWER(me.my_col)' => 'my search string' }) -- Eden Cardim Software Engineer Shadowcat Systems Ltd. http://www.shadowcat.co.uk http://blog.edencardim.com

Re: [Dbix-class] Duplicate me.id in WHERE clause of simple query

2011-01-26 Thread Eden Cardim
ue of the column via get_column. Relying on get_column impoverishes your API, with a specific per-column accessor it's much easier to install hooks/extensions. -- Eden Cardim Software Engineer Shadowcat Systems Ltd. http://www.shadowcat.co.uk http://blog.edencardim.com _

Re: [Dbix-class] best way to cleanse / validate data

2011-01-18 Thread Eden Cardim
I Seth> calls. Don't use different API calls then, use a single API, validate there and make all the other components talk to it. Depending on what you need, even a simple method modifier like override/around applied to the accessor can do the trick. -- Eden Cardim Software Engin

Re: [Dbix-class] best way to cleanse / validate data

2011-01-17 Thread Eden Cardim
7;m also looking for a good way to validate the incoming data for Seth> certain columns. Again, I was hoping using MooseColumns would allow me Seth> to use Moose's type system, but since the accessors don't get called for Seth> some common DBIx::Class methods the

Re: [Dbix-class] Re: Testing for a join

2010-12-21 Thread Eden Cardim
;check" logic in each resultset class appropriately. Of course, this doesn't work for multiple joins, and I'd suggest a view for that anyway. -- Eden CardimNeed help with your perl Catalyst or DBIx::Class project? Software Engineer

Re: [Dbix-class] Re: Testing for a join

2010-12-20 Thread Eden Cardim
gt;related_resultset('label')->check_deleted; ->resultset('CD')->related_resultset('tracks')->check_deleted; and you'd implement check_deleted() on RS::Label and RS::Track without having to know whether 'CD' is joined or not. --

Re: [Dbix-class] Knowing the correct alias

2010-11-23 Thread Eden Cardim
t;search({ "$alias.id" => $id } ); Bill> } Yes, there's a method for that though, $rs->current_source_alias -- Eden CardimNeed help with your perl Catalyst or DBIx::Class project? Software Engineer http://www.shadowcat.co.uk/cataly

Re: [Dbix-class] What namespace is best for a ResultSet Class with Custom methods

2010-11-02 Thread Eden Cardim
n> folder. However I recently came across this Tutorial Gurunandan> that advises: This will not make the method be available in both classes, and the requirement of a custom method being magically available in both classes makes no sense without more detail. Can you explain what you'

Re: [Dbix-class] load_namespaces with extra resultset base class, without defining each one?

2010-11-01 Thread Eden Cardim
ltSet::Books Oleg> \My::Schema::ResultSet::Authors Result/ResultSet are just default namespaces, you can customize the namespace you want and even provide multiple namespaces, which will fulfil the requirements of the OP. See the doc for load_namespaces() in DBIx::Class::Schema. -- Eden

Re: [Dbix-class] Dinamic join conditions

2010-09-07 Thread Eden Cardim
> $r->id, Tiziano> group_desc => $r->group_desc, group_name => $r->group_name, Tiziano> cansee => defined $r->{role_id} ? JSON::XS::true : Tiziano> JSON::XS::false }; Thanks guys! try: $rs->search({},{ '+select' => [qw(role

Re: [Dbix-class] minimalistic Moose / DBIC glue module

2010-06-28 Thread Eden Cardim
> "Octavian" == Octavian Rasnita writes: Octavian> What do you think it is the preferable way of passing the Octavian> parameters to the custom methods defined in the ResultSet Octavian> class for other more complex methods like ->search(), Octavian> update(), create(), update

Re: [Dbix-class] minimalistic Moose / DBIC glue module

2010-06-26 Thread Eden Cardim
> "John" == John Napiorkowski writes: John> I generally try to do this as well, however I find that doing John> this for simple finds on primary keys gets a bit tedious, and John> frankly I wonder if I'm not wasting time and adding to John> complexity. Would be interested in

Re: [Dbix-class] minimalistic Moose / DBIC glue module

2010-06-23 Thread Eden Cardim
> "Drew" == Drew Taylor writes: Drew> I had thought in the past about where to separate the business Drew> logic. Do I do it in MyApp::Hotel or Drew> MyApp::Schema::Result::Hotel? Obviously canned queries go in Drew> MyApp::Schema::ResultSet::Hotel, but where's the dividing l

Re: [Dbix-class] minimalistic Moose / DBIC glue module

2010-06-22 Thread Eden Cardim
> "BUCHMULLER" == BUCHMULLER Norbert writes: BUCHMULLER> So I came up with a more minimalistic approach that only BUCHMULLER> solves the above two problems and nothing else: BUCHMULLER> 1. it installs Moose accessors on the Result (Row) BUCHMULLER> objects that perform get_col

Re: [Dbix-class] How to alter table via DBIC?

2010-06-22 Thread Eden Cardim
> "Chris" == Chris Cole writes: Chris> Oh, right. This is a locked down server that is only Chris> accessible from within the building. The database is being Chris> used for research purposes with no sensitive data, so hacking Chris> is not a real problem. Chris> Plus, th

Re: [Dbix-class] Alias column names

2010-04-20 Thread Eden Cardim
en designing new applications it's recommendable that you stay away from methods that imply knowledge of your store architecture (such as create, update, search and insert). -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkey

Re: [Dbix-class] Insert into join table succeeds but issues error anyway

2010-04-19 Thread Eden Cardim
ails [ snip ] > with ParamValues: 0='HASH(0xb57f080)', 1='66'] at You're attempting to insert a hashref into the database, fix your ->create() call -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadow

Re: [Dbix-class] Moose DBIx::Class

2010-03-21 Thread Eden Cardim
On 18/03/2010, at 08:47, Андрей Костенко wrote: No, because I make query one time and use accessors for many operations. A lot of NYTProf cals tell me, that Class::Accessor::Grouped::get_inherited is the slowest part in my applications. In that case, you need to inflate to a faster data str

Re: [Dbix-class] Duplicate entry error on create

2009-12-10 Thread Eden Cardim
>>>>> "Dermot" == Dermot writes: Dermot> Oh! Should I be using the name of the accessor_name from the Dermot> belongs_to? Precisely, if it's a "belongs_to" you want to pass it a hashref, if it's a "has_many" you want to pa

Re: [Dbix-class] Duplicate entry error on create

2009-12-09 Thread Eden Cardim
change this to __PACKAGE__->belongs_to( "contributor", "MyAPP::Schema::Contributors", { contributor_id => "contributor_id" }, ); To avoid confusion between the contributor relationship and the contributor_id column. -- Eden Cardim Need help with

Re: [Dbix-class] Duplicate entry error on create

2009-12-09 Thread Eden Cardim
y cascade into related tables? No, you're just doing it wrong, try: my $row = $schema->resultset('Products')->find_or_create( { distribution => 1, caption => 'Earth', contributor => { code => $var, name => $name } } );

Re: [Dbix-class] many to many insert

2009-12-03 Thread Eden Cardim
TICREATE_DEBUG environment variable set to a true value then show us the result along with the table class declarations (verbatim, all of it). -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/catalyst/

Re: [Dbix-class] Re: Using DBIx::Class to copy data between different RDBMS

2009-12-03 Thread Eden Cardim
ead. Phillip> Do I need to force a query of every possible column for Phillip> each row, to ensure that lazy population doesn't result in Phillip> missing data in my SQLite copy of the data? If you don't mess with 'select' in evil ways, you're good.

Re: [Dbix-class] MSSQL - problem sorting by joined column while limiting rows

2009-11-09 Thread Eden Cardim
> "Alan" == Alan Humphrey writes: Alan> Hi - If I try to sort by a column in a joined table in a MSSQL Alan> database AND limit the number of rows, the generated SQL is Alan> bad. Here's the code: Alan> my $result = Alan> $schema->resultset('SurveyorsSurveySites')->searc

Re: [Dbix-class] additional condition in LEFT JOIN in DBIx::Class

2009-09-17 Thread Eden Cardim
In raw SQL it needs name condition to be placed in LEFT JOIN: > > SELECT * > FROM users AS u > LEFT JOIN attributes AS a >    ON u.id=a.users_id >    AND a.name="car" > WHERE a.users_id IS NULL > > How to force DBIx::Class to add this > > AND a.

Re: [Dbix-class] Using Database Functions

2009-09-14 Thread Eden Cardim
On Tue, Sep 15, 2009 at 1:05 AM, Eden Cardim wrote: > while(my $year = $year->next) { do_something($year) } erm, actually: while(my $year = $year_cols->next) { do_something($year) } -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Co

Re: [Dbix-class] Using Database Functions

2009-09-14 Thread Eden Cardim
> [ { YEAR => 'date' }], as => ['year'], distinct => 1 }); my $year_cols = $years->get_column('year'); # returns a DBIx::Class::ResultSetColumn while(my $year = $year->next) { do_something($year) } -- Eden Cardim Need help with your Catalyst

Re: [Dbix-class] possibility of hashref argument to Relationship::Base::proxy

2009-08-29 Thread Eden Cardim
od with a different name in the target class, then declare a proxy to that? -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platf

Re: [Dbix-class] DBIx::Class, another data validation approach

2009-07-21 Thread Eden Cardim
bar' ]". Look at how Moose does this. Once DBIC migrates to Moose we should get all of this relatively transparently. > 3) Different DBMSes have different types. So, maybe producer-specific > validations would be helpful (q.v. #1). For Moose I'd make the storage class loa

Re: [Dbix-class] Local DB Mirror

2009-07-21 Thread Eden Cardim
tures, do your development, then load the fixtures on the remote server and run the tests to fix any incompatibilities. -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Wan

Re: [Dbix-class] Is it possible to search with the accessor instead of the column name?

2009-01-06 Thread Eden Cardim
app's search conditions. > Also, where is the hash describing a column documented besides the Intro? DBIx::Class::ResultSource -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Sys

Re: [Dbix-class] Restricting Result Sets

2008-11-07 Thread Eden Cardim
hink you need DBIx::Class::Schema::RestrictWithObject -- Eden Cardim Need help with your Catalyst or DBIx::Class project? Code Monkeyhttp://www.shadowcat.co.uk/catalyst/ Shadowcat Systems Ltd. Want a managed development or deployment platform? http://edenc

Re: [Dbix-class] Problems using a database function in the where clause

2008-07-21 Thread Eden Cardim
On Mon, Jul 21, 2008 at 4:59 AM, Moritz Onken <[EMAIL PROTECTED]> wrote: > But how can I rewrite my query to the other format without writing the raw > sql where clause? > Why is it not possible to write my query with as scalar ref: > > $rs->search({ > -and => >[ > {\"extract(year from age

Re: [Dbix-class] Providing unified interface through DBIx::Class

2008-07-15 Thread Eden Cardim
On Tue, Jul 15, 2008 at 9:59 AM, Andreas Pronakis <[EMAIL PROTECTED]> wrote: > Is this possible/worth exploring? > > Does anyone know which parts of DBIC would/potentially need to be sub-classed > to achieve this? > > Has anyone attempted something like this before? If so how did they go about >

Re: [Dbix-class] Having access to both resultset list AND resultset methods

2008-04-07 Thread Eden Cardim
On Mon, Apr 7, 2008 at 2:33 PM, Emily Heureux <[EMAIL PROTECTED]> wrote: > Hi, I have a resultset call like this in my Catalyst application: > $rs = [$c->model('DB::Table1)->search( > > { … > > }, > > { join => [ …] > > } > > )]; > The reason