Re: FW: [Dbix-class] Filtering module

2008-11-13 Thread Octavian Rasnita
From: Matt S Trout [EMAIL PROTECTED] $obj-get_column($col); # COLUMN VALUE $obj-$col; # ATTRIBUTE VALUE If I could time travel, I'd make it _get_column so this fact was obvious. But too much code now relies on it, sadly. I suspect when we create a new, cleaner row object interface, perhaps

Re: [Dbix-class] convention for naming primary keys to avoid ambiguousselects

2008-11-25 Thread Octavian Rasnita
From: David Schmidt [EMAIL PROTECTED] Hello List, I used to have an id INTEGER PRIMARY KEY column in every table. Now I am using DBIC and repeatedly run into this kind of error. SELECT me.id, me.title, me.artist FROM cds me WHERE ( me.artist = ? ): '2' SELECT me.id, me.title, me.artist,

Re: [Dbix-class] convention for naming primary keys to avoidambiguousselects

2008-11-25 Thread Octavian Rasnita
From: Noel Burton-Krahn [EMAIL PROTECTED] This is a reasonable query: load a person with address by the person's id. The 'id' column is unambiguous in the search call. However, DBIx generates ambiguous SQL: DBIx::Class::ResultSet::count(): DBI Exception: DBD::mysql::st execute failed: Column

Re: [Dbix-class] convention for naming primary keysto avoidambiguousselects

2008-11-25 Thread Octavian Rasnita
From: Peter Rabbitson [EMAIL PROTECTED] I think that if the query needs to search in a table named me which is not the primary table, it probably gives another name instead of me for the main table, so that name shouldn't need to be hard coded in the programs. By the way, does anyone know what

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC- bug?)

2010-01-19 Thread Octavian Rasnita
From: Ronald J Kimball rkimball+dbixcl...@pangeamedia.com Thomas L. Shinnick wrote: I'm having some of the same questions regarding +select and +as . It seems that using '+select' and '+as' does not stop other columns from being returned. I'm using DBIC 0.08115. What do you expect +select

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC-bug?)

2010-01-19 Thread Octavian Rasnita
From: iain iainhubb...@googlemail.com my $uuu = $schema-resultset('User')-search({},{ prefetch = {blogs = 'blog_comments'}, select = ['me.id'], as = ['user_id'], }); print $uuu-first-username; I think the single column that should be printed should be me.id, but here is the generated SQL:

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables(DBIC-bug?)

2010-01-20 Thread Octavian Rasnita
From: Carl Johnstone dbixcl...@fadetoblack.me.uk Octavian Rasnita wrote: my $uuu = $schema-resultset('User')-search({},{ prefetch = {blogs = 'blog_comments'}, select = ['me.id'], as = ['user_id'], }); print $uuu-first-username; I know, but I would like to prefetch only just a few columns from

Re: [Dbix-class] Removing rows older than a given number of minutes ...

2010-01-23 Thread Octavian Rasnita
From: Rob Kinyon rob.kin...@gmail.com On Sat, Jan 23, 2010 at 16:28, Kiffin Gish kiffin.g...@planet.nl wrote: I want to delete all rows with a given state which have not been modified for a given time in seconds. my @rows = rs-search({ state = $state }, { last_modified = ??? }); $_-delete for

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

2010-02-15 Thread Octavian Rasnita
From: Robert Sedlacek r...@474.at Hey Nick, Nick Wellnhofer wrote: It's simply an optimization. I have a table with a text column that can contain tens of KB of data per row. I also have some queries that don't need that column, so I'd like to avoid unnecessarily fetching all that content

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

2010-02-18 Thread Octavian Rasnita
From: fREW Schmidt fri...@gmail.com On Thu, Feb 18, 2010 at 7:02 AM, BUCHMULLER Norbert norbi.li...@nix.huwrote: On Wed, 17 Feb 2010 09:19:44 -0600 fREW Schmidt wrote: 1. Only have the remove-columns affect the default select, since having it affect an explicit columns list is a little

Re: [Dbix-class] Unicode conversion problems

2010-07-06 Thread Octavian Rasnita
Hi Jesse, Check: http://blog.hno3.org/2010/04/22/fixing-double-encoded-utf-8-data-in-mysql/ or search for mysql double encoding with Google and you'll find more step by step instructions. I also had that problem and I dumped a few tables with mysqldump (because not all the tables were

[Dbix-class] test2 - from ssifbroker

2010-09-03 Thread Octavian Rasnita
Octavian ___ 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: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

[Dbix-class] test1 from gmail

2010-09-03 Thread Octavian Rasnita
Octavian ___ 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: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

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

2011-02-08 Thread Octavian Rasnita
From: Jim Green student.northwest...@gmail.com Hello, when I was reading about moose and orm I found dbic will be based on moose in next major release. I am currently using RDBO and was satisfied with it with some exceptions(no sybase support right now, no potential move to moose).. RDBO has

Re: [Dbix-class] DBIx::Class with PerlApp

2011-02-16 Thread Octavian Rasnita
I have succeeded to build a Windows executable using: perlapp --add=Moose --add=MooseX::NonMoose --add=MooseX::NonMoose::Meta::Role::Class --add=MooseX::NonMoose::Meta::Role::Constructor --add=namespace::autoclean --add=DBIx::Class::Schema test.pl And the program test.pl is a simple program

Re: [Dbix-class] DBIx::Class with PerlApp

2011-02-16 Thread Octavian Rasnita
From: Peter Rabbitson rabbit+d...@rabbit.us Octavian Rasnita wrote: And it works, although with a low performance because DBIx::Class has a big startup lag. This is not really correct. The slow startup comes from FS operations while load_namespaces scans for result classes

Re: [Dbix-class] Module versioning

2011-04-14 Thread Octavian Rasnita
From: Robert Kinyon rob.kin...@gmail.com At $work, we build RPMs of the stuff we depend on. Then, we build RPMs of our stuff with dependencies on the RPMs we built of CPAN modules. Then, we have our own internal RPM repository that we deploy to prod from. That way, we control our upgrades,

Re: [Dbix-class] Dummy DBIC columns?

2011-05-16 Thread Octavian Rasnita
From: Bill Moseley I have two databases that are very similar. For example, the person table in one db has an email column and the other does not have that column, otherwise the tables are the same. My application uses the schema with the table that has the email column, so there's

[Dbix-class] Does DBIC support -create() with more clob fields?

2012-01-29 Thread Octavian Rasnita
Hi all, I have an Oracle table with 2 clob columns and I am trying to add a new record in it, using: my $row = $schema-resultset( 'TblName' )-create( { question = 'This is the first question', answer = 'Answer 1', date_time_q = '2012-01-01 00:00:00', date_time_a = '2012-01-01

Re: [Dbix-class] Does DBIC support -create() with more clob fields?

2012-01-29 Thread Octavian Rasnita
From: Peter Rabbitson rabbit+d...@rabbit.us Octavian Rasnita wrote: Hi all, I have an Oracle table with 2 clob columns and I am trying to add a new record in it, using: my $row = $schema-resultset( 'TblName' )-create( { question = 'This is the first question', answer = 'Answer

[Dbix-class] Using a scalar ref with update_or_create

2012-03-16 Thread Octavian Rasnita
Hi, I have tried to use: $self-update_or_create({ symbol = $symbol, market = $market, last_update = \'now()', }); Am I doing something wrong? The problem is the row: last_update = \'now()', ...because the generated SQL for select looks like: SELECT ... FROM table_name me WHERE ( ( ...

Re: [Dbix-class] Using a scalar ref with update_or_create

2012-03-19 Thread Octavian Rasnita
From: Websuche :: Felix Ostmann Subject: Re: [Dbix-class] Using a scalar ref with update_or_create We run into the same problem and simple split the problem. Make a find, then update or create (simple look what update_or_create do internally) Oh, so the answer to my question seems to

[Dbix-class] It is not possible to downgrade a schema...

2012-08-27 Thread Octavian Rasnita
Hi, Using Catalyst helper I tried to update the DBIC schema that was created with the Catalyst helper, but on another computer, and it gave the following error: DBIx::Class::Schema::Loader::make_schema_at(): It is not possible to downgrade a schema that was loaded with use_moose = 1 to

[Dbix-class] Correct (and secure) searching using -like?

2012-10-08 Thread Octavian Rasnita
Hi, I've seen examples of searching in a database using the LIKE operator like: $rs = $rs-search( { name = { -like = %$name% }, } ); It doesn't look to be very secure to quote the variable $name this way. Or maybe the special chars in the whole composed string %$name% are then escaped if

Re: [Dbix-class] Correct (and secure) searching using -like?

2012-10-09 Thread Octavian Rasnita
From: will trillich Octavian -- Inlining the values, as you say, would be fraught with peril -- DBI (and DBIx::Class) know better, so it's not a problem. It's not special to the -like operator, it's part of how DBIC works. [cut] So if someone put nefarious strings in one of the ID

Re: [Dbix-class] Correct (and secure) searching using -like?

2012-10-09 Thread Octavian Rasnita
From: Bill Moseley On Mon, Oct 8, 2012 at 12:49 AM, Octavian Rasnita orasn...@gmail.com wrote: It doesn't look to be very secure to quote the variable $name this way. It's still a bind parameter. But, what I do is remove any existing special characters and make sure $name has

[Dbix-class] order by field?

2012-12-17 Thread Octavian Rasnita
Hi, In MySQL is possible to do something like: select * from table_name order by field(department, 'Marketing', 'Sales', 'Financial', 'IT', 'Operations'); In other databases it should be done differently Is it possible to do this search with DBIC? --Octavian

Re: [Dbix-class] order by field?

2012-12-18 Thread Octavian Rasnita
From: Peter Rabbitson rabbit+d...@rabbit.us On Mon, Dec 17, 2012 at 11:04:22AM +0100, QE :: Felix Ostmann wrote: I am doing such a order with the following SQL: ... ORDER BY (department = 'Marketing') DESC, (department = 'Sales') DESC, (department = 'Financial') DESC,

Re: [Dbix-class] order by field?

2012-12-18 Thread Octavian Rasnita
From: Peter Rabbitson rabbit+d...@rabbit.us On Tue, Dec 18, 2012 at 10:53:25AM +0200, Octavian Rasnita wrote: From: Peter Rabbitson rabbit+d...@rabbit.us On Mon, Dec 17, 2012 at 11:04:22AM +0100, QE :: Felix Ostmann wrote: I am doing such a order with the following SQL: ... ORDER

Re: [Dbix-class] order by field?

2012-12-18 Thread Octavian Rasnita
From: Peter Rabbitson rabbit+d...@rabbit.us On Tue, Dec 18, 2012 at 10:53:25AM +0200, Octavian Rasnita wrote: From: Peter Rabbitson rabbit+d...@rabbit.us On Mon, Dec 17, 2012 at 11:04:22AM +0100, QE :: Felix Ostmann wrote: I am doing such a order with the following SQL: ... ORDER

Re: [Dbix-class] Fine-tuning of prefetched relationships

2013-04-01 Thread Octavian Rasnita
From: Peter Rabbitson rabbit+d...@rabbit.us what is so scary/undesirable about modifying the schema ? That is a real question - you are not the first to word things thusly. I need to figure out where the fear to add an extra definition is coming from. Cheers I can tell you my source

[Dbix-class] Features comparison among ORMS?

2013-11-10 Thread Octavian Rasnita
Hi, Does anyone know if there is somewhere a features comparison among the most used ORMS? I tried to find one that includes Hybernate, ActiveRecord, SQLAlchemy, DBIC, but I couldn't find such a thing. I found a lot of comparisons for Java and DotNet ORMS and usually speed benchmarks.

Re: [Dbix-class] Features comparison among ORMS?

2013-11-11 Thread Octavian Rasnita
Hi Rob, From: Rob Kinyon rob.kin...@gmail.com What sort of features are you looking for? All the Perl ORMs wrap DBI, so connecting to different databases isn't a problem. Among the Perl ORMs, only DBIx::Class has resultsets, arguably the most powerful ORM concept. (It's not just among Perl

[Dbix-class] Error when using distinct = 1 with select = ...

2015-01-18 Thread Octavian Rasnita
Hello, I tried to use the following select query, but it gives an error: use TB::Schema; $ENV{DBIC_TRACE}++; my $schema = TB::Schema-connect( dbi:mysql:intranet, root ); my $rs = $schema-resultset('Performance')-search( {}, { select = [ { date = 'date_time' } ], as = [ 'date' ],