Re: [Dbix-class] resultset_attributes, where, undef - wotz up?

2010-07-16 Thread Moritz Onken
Am 16.07.2010 um 10:18 schrieb Benjamin Martin: Hello everyone, I have a ResultSet where I have used the 'resultset_attributes' to restrict which records get returned from search etc. ... ala the documentation: __PACKAGE__-resultset_attributes({ where = { deleted = undef } }); In

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

2010-05-25 Thread Moritz Onken
On Tue, 25 May 2010 21:28:45 +0200, BUCHMULLER Norbert norbi.li...@nix.hu wrote: Hi Guys, at the company where I work we are trying to make DBIC and Moose befriend: ie. making the Result (Row) objects regular Moose objects (as much as reasonable), so that we can use type constraints,

Re: [Dbix-class] Moose wrapper around DBIC

2010-04-07 Thread Moritz Onken
um 19:45 schrieb Oleg Kostyuk: Very interesting. Where it's possible to look at sources? 2010/3/24 Moritz Onken on...@houseofdesign.de: Hi, the latest discussion about using Moose and DBIC got me thinking and I started a little proof of concept project. It's called MooseX:DBIC

[Dbix-class] Moose wrapper around DBIC

2010-03-24 Thread Moritz Onken
Hi, the latest discussion about using Moose and DBIC got me thinking and I started a little proof of concept project. It's called MooseX:DBIC. It contains a MooseX::DBIC::Schema class which is a subclass of DBIx::Class::Schema. The idea is to have a layer which takes Moose classes and generates

Re: [Dbix-class] Cascade deletes

2010-03-06 Thread Moritz Onken
I notice that DBIC does a select to find the related rows (i.e. in the Cd table when looking for rows to cascade delete). Is there a reason that's done instead of just deleting directly? INSERT INTO artist ( label, name) VALUES ( ?, ? ): '1', 'test aritst' INSERT INTO cd ( artist)

Re: [Dbix-class] Constructing a resultset()-search() with variable number of ORs?

2009-10-27 Thread Moritz Onken
Am 26.10.2009 um 17:36 schrieb Chris Cole: Hi, I'd like to convert the below code to using a variable number of ORs on the 'name' column. i.e. there may be a data3 as well as data1 and data2. my $schema = DB::Schema-connect(); my @rows = $schema-resultset('Reads2expt')-search( #

Re: [Dbix-class] Fwd: Simple query makes SQL::Abstract puke

2009-10-08 Thread Moritz Onken
Am 08.10.2009 um 14:18 schrieb Ido Perlmuter: -- Forwarded message -- From: Ido Perlmuter i...@ido50.net Date: Wed, Oct 7, 2009 at 6:40 PM Subject: Simple query makes SQL::Abstract puke To: dbix-class@lists.scsys.co.uk Hi. For some reason, the following query has been

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

2009-07-28 Thread Moritz Onken
Am 28.07.2009 um 10:59 schrieb Alexander Hartmaier: Am Dienstag, den 28.07.2009, 00:29 +0200 schrieb Rob Kinyon: On Thu, Jul 23, 2009 at 08:28, Alexander Hartmaieralexander.hartma...@t-systems.at wrote: The DBMS validates data types, length, undef and foreign keys anyway, so maybe using it

Re: [Dbix-class] InflateColumn::DateTime doesn't understand timestamp without timezone

2009-07-22 Thread Moritz Onken
More important, what's your current version of InflateColumn::DateTime? Is it up to date? ___ 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/

Re: [Dbix-class] PATCH: Support for arbitrary SQL in relationship definition

2009-06-30 Thread Moritz Onken
Am 30.06.2009 um 18:10 schrieb David Ihnen: Rob Kinyon wrote: Now, if someone can provide a solid use-case, then I'll be onboard. But, adding features for the sake of adding features is how you end up with a crappy API. Rob Lets see if I can argue the use case. I tripped over this

Re: [Dbix-class] Per column filter

2009-06-18 Thread Moritz Onken
Am 18.06.2009 um 14:18 schrieb Pedro Melo: Hi, I'm wrapping DBIx::Class over a legacy database that uses the iso-8859-1 charset internally. My app expects all perl strings as utf8. I'm trying to write an extension to DBIC that decodes the value from the DB into utf8, and does the

Re: [Dbix-class] Problem with join

2009-05-29 Thread Moritz Onken
Am 29.05.2009 um 16:50 schrieb Андрей Костенко: Has I can write in DBIx::Class this query: SELECT * FROM table1 LEFT JOIN table2 ON table2.table1_id=table2.id AND table2.user_id=123? Where user_id is an any random number. Depends on your schema. I'd say this is equivalent to: SELECT

Re: [Dbix-class] issue with deploy() and pgsql's timestamp with time zoneUser-Agent: SquirrelMail/1.5.2 [SVN]

2009-05-26 Thread Moritz Onken
Am 23.05.2009 um 22:14 schrieb Moritz Onken: Am 23.05.2009 um 19:32 schrieb Guillaume Chambriat: Hi, I've a PostgreSQL table: create table date_fields ( id serial primary key, message integer references messages(id) on delete cascade, value timestamp

Re: [Dbix-class] Getting a' count' value

2009-05-14 Thread Moritz Onken
Am 14.05.2009 um 14:16 schrieb Emmanuel Quevillon: Hi, Sorry if my question looks stupid, but I'd like to retrieve the value of a count returned by an SQL query. I tried different things but it always return 1 Here is the way I'd like it to work: ... acc = $g-name(), num =

Re: [Dbix-class] Need help with PgSQL fulltext search queries

2009-05-07 Thread Moritz Onken
Am 07.05.2009 um 10:16 schrieb Alex Kapranoff: Good day to all! (this is either a DBIx::Class, SQL::Abstarct or PgSQL fulltext search + Perl question) Can someone please help +selecting a function with several parameters? This is the code we came up with. The problem is, $search_text

Re: [Dbix-class] dirty-flag on inflated columns

2009-05-04 Thread Moritz Onken
Am 04.05.2009 um 17:18 schrieb Morgon Hed: Hi! I have a XML-column that I inflate/deflate to an object. What works is to create a new instance of such an object and pass that to the column-accessor, then when updating the object is deflated and stored in the database. The problem now

Re: [Dbix-class] bad column names?

2009-03-10 Thread Moritz Onken
Am 09.03.2009 um 23:24 schrieb fREW Schmidt: Hi all! We are dealing with some weird issues because our database has silly column names. Specifically speaking we have a column called 'user'. user is a reserved word in T-SQL (we are using SQL Server.) Anyway, this is the error we get:

Re: [Dbix-class] bad column names?

2009-03-09 Thread Moritz Onken
Am 09.03.2009 um 20:06 schrieb fREW Schmidt: Hi all! We are dealing with some weird issues because our database has silly column names. Specifically speaking we have a column called 'user'. user is a reserved word in T-SQL (we are using SQL Server.) Anyway, this is the error we get:

Re: [Dbix-class] -deply doesn't honour qoute_char

2009-01-17 Thread Moritz Onken
Am 17.01.2009 um 06:35 schrieb Ashley: http://www.mail-archive.com/dbix-class@lists.scsys.co.uk/msg02450.html What am I, chopped Warnock? :( Producer::PG and Produver::SQLite have very much in common. Du you think it make sense to subclass from Postgres and modify sub producer and friends,

Re: [Dbix-class] RFC: InflateColumn::FS

2008-10-04 Thread Moritz Onken
Am 03.10.2008 um 19:37 schrieb Marc Mims: * Matt S Trout [EMAIL PROTECTED] [081001 18:40]: I'll happily give you svn space for it and we can figure out how to deprecate IC::File in favour of it later. Just let me know when you're ready for it and get it into svn. Consider

Re: [Dbix-class] RFC: InflateColumn::FS

2008-10-04 Thread Moritz Onken
Am 04.10.2008 um 16:07 schrieb Marc Mims: * Moritz Onken [EMAIL PROTECTED] [081004 06:10]: You can SHA each column of the primary key and then SHA the joined SHAs. SHA(SHA(A).SHA(B)) != SHA(AB); Perfect! Thanks. Hi Marc, I had a quick glance at your code and have some questions

Re: [Dbix-class] RFC: InflateColumn::FS

2008-10-04 Thread Moritz Onken
You can override _fs_column_dir to provide directory tree nesting however you like. I would still like to make this a config option, somehow, but this is a start. Hi Marc, I think your code covers everything. Well, actually there is one more thing: It would be great if one could specify a

Re: [Dbix-class] RecursiveUpdate and many to many

2008-09-30 Thread Moritz Onken
Am 29.09.2008 um 17:50 schrieb Matt S Trout: On Sun, Sep 28, 2008 at 05:56:11PM +0100, Oliver Gorwits wrote: Ideally, DBIC would instead populate the relationship_info details after someone has set up __PACKAGE__-many_to_many(...). That would avoid this guesswork. Why is there no

Re: [Dbix-class] multiple has_many rels in prefetch not supported in 0.081?

2008-08-26 Thread Moritz Onken
Am 25.08.2008 um 20:43 schrieb Matt S Trout: On Sat, Aug 23, 2008 at 08:53:27AM +0200, Moritz Onken wrote: Something like: my $search = { }; my $attr = { prefetch = [ qw/tracks tags/ ] }; my $cd = $schema-resultset(Artist)-first-cds-search($search, $attr)-first; $cd-tracks-all; $cd-tags

Re: [Dbix-class] multiple has_many rels in prefetch not supported in 0.081?

2008-08-23 Thread Moritz Onken
Am 22.08.2008 um 23:42 schrieb Peter Rabbitson: Moritz Onken wrote: Hi, I installed the latest svn revision of DBIx-Class-0.08099_04 and my code fails serval times because I prefetch multiple has_many rels. This was no problem with 0.08010. Why did you change this behaviour? I didn't

[Dbix-class] multiple has_many rels in prefetch not supported in 0.081?

2008-08-22 Thread Moritz Onken
Hi, I installed the latest svn revision of DBIx-Class-0.08099_04 and my code fails serval times because I prefetch multiple has_many rels. This was no problem with 0.08010. Why did you change this behaviour? I didn't read anything about this on thsi list. I have to change a lot of code for

Re: [Dbix-class] DBIC hits DB thoguh using prefetch (repost)

2008-08-18 Thread Moritz Onken
And now somebody's saved me the trouble of figuring out which bloody test it was in I'll try and have a go this week :) Hi, don't want to bug you but did you have a look at this? moritz ___ List:

Re: [Dbix-class] DBIC hits DB thoguh using prefetch (repost)

2008-07-29 Thread Moritz Onken
Also, did you look at the existing tests for the one that should already cover this like I suggested? It'd be awful for you to go to the trouble of writing a test when there's already a TODO one in the code. Grepping for TODO did the trick. Found it in 77prefetch.t line 349. I guess

Re: [Dbix-class] DBIC hits DB thoguh using prefetch (repost)

2008-07-27 Thread Moritz Onken
Hi Moritz, Nope, you're misunderstanding how it works. Search with prefetch fetches data and stores it in the resultset when next/all are called on the resultset. However find() doesnt use prefetched data at all, there is no caching for find. $rs-first, doesnt run any extra queries.

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

2008-07-23 Thread Moritz Onken
$rs-search({ -and = [ {\extract(year from age(NOW(),birthday)) = 22}, {sex = male} ] }); Have you tried the other way around? -and = [ { '' = \'extract(year from age(NOW(),birthday))'}, {sex = male} ] I couldn't understand what is the 22 doing there. This query fetches all males

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

2008-07-21 Thread Moritz Onken
Hi, referring to http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Manual/Cookbook.pod#Using_SQL_functions_on_the_left_hand_side_of_a_comparison I tried to run this query: $rs-search({ -and = [ {extract(year from age(NOW(),birthday)) = 22}, {sex = male} ] });

Re: [Dbix-class] DBIC hits DB thoguh using prefetch (repost)

2008-07-20 Thread Moritz Onken
Am 20.07.2008 um 02:53 schrieb Matt S Trout: On Tue, Jul 08, 2008 at 09:47:50AM +0200, Moritz Onken wrote: Hi, sorry for the repost, but there was no answer to my previous post. And yet you provided no new information to help us diagnose the problem. Hint: If you get no answer it usually

[Dbix-class] DBIC hits DB thoguh using prefetch (repost)

2008-07-08 Thread Moritz Onken
Hi, sorry for the repost, but there was no answer to my previous post. I have a table 'categories' which has a many_to_many relationship to itself using a table 'map_categories'. I found out that prefetching a many_to_many rel does not work. So I prefetched the has_many rel to

[Dbix-class] Avoid DB hit with many_to_many rel

2008-06-25 Thread Moritz Onken
Hi, I have a table 'categories' which has a many_to_many relationship to itself using a table 'map_categories'. I found out that prefetching the many_to_many rel does not work. So I prefetched the has_many rel to 'map_categories' (parents) and prefetch the belongs_to rel (parent) from

Re: AW: [Dbix-class] Avoid DB hit with many_to_many rel

2008-06-25 Thread Moritz Onken
Am 25.06.2008 um 16:23 schrieb Hartmaier Alexander: Hi! many_to_many is no relationship but a relationship helper, so it can't be prefetched. You can of course prefetch the two relationships it consists of. Hi, thanks. But I found that out already. As I wrote I already prefetch the

[Dbix-class] get $author from a row $author-books-first

2008-04-25 Thread Moritz Onken
Hi, I want to add a new method to my Book class. This methods needs to call a relationship of $author. So how do I get the $author object if I am calling a function in the Book class. I get the row object by calling $book = $author-books-first (or similar). I read the docs but couldn't

Re: [Dbix-class] get $author from a row $author-books-first

2008-04-25 Thread Moritz Onken
Am 25.04.2008 um 17:00 schrieb Matt S Trout: On Fri, Apr 25, 2008 at 01:56:38PM +0200, Moritz Onken wrote: Hi, I want to add a new method to my Book class. This methods needs to call a relationship of $author. So how do I get the $author object if I am calling a function in the Book class. I

Re: [Dbix-class] get $author from a row $author-books-first

2008-04-25 Thread Moritz Onken
thanks Brian, thanks Matt, I think I have to redesign my classes. If I can think of a generic problem where it could be necessary to retrieve the related object I'll tell you :) thanks! moritz ___ List:

Re: [Dbix-class] Paging all re nested sets

2008-04-05 Thread Moritz Onken
Am 05.04.2008 um 18:00 schrieb Sebastian Willert: Unfortunately it's not as easy as this. Off the top of my head: transactional isolation just prevents dirty reads wrt. this problem, i.E. reading an inconsistent state. Understood. But the transaction could include a read which checks

Re: [Dbix-class] ON DELETE statement in Pg not avaiable in schema::loader?

2008-03-24 Thread Moritz Onken
Am 21.03.2008 um 17:43 schrieb Matt S Trout: On Sat, Mar 08, 2008 at 06:11:22PM +0100, Moritz Onken wrote: Wouldn't it be great (tm) if we could add an on_delete and on_update config to all the relationships? Like the cascade_delete config option. If the DMBS supports that type of actions DBIC

Re: [Dbix-class] ON DELETE statement in Pg not avaiable in schema::loader?

2008-03-08 Thread Moritz Onken
not been done :-) Am 08.03.2008 um 17:58 schrieb Matt S Trout: On Tue, Feb 26, 2008 at 01:17:37PM +0100, Moritz Onken wrote: Hi, I use the ON DELETE statements in my Pg database to set the foreign key to null if a column is deleted. But this information doesn't make it's way to the schema if I use

Re: [Dbix-class] lower on column and query

2008-03-01 Thread Moritz Onken
Interestingly, I thought about the same problem yesterday, I was looking at the difference of LIKE in postgres and mysql. Seems like LIKE in postgres is case sensitive and in mysql it's not. So you have to use ILIKE in postgres to get the same behaviour as LIKE in mysql. To make an

Re: [Dbix-class] ON DELETE statement in Pg not avaiable in schema::loader?

2008-02-29 Thread Moritz Onken
Hi again, Matt wrote some weeks ago a nice mail that we should push postgres a little bit. I'd like to write some code which supports postgres even more but I need some help. So maybe someone could write something to my earlier post. moritz Am 26.02.2008 um 13:17 schrieb Moritz Onken

Re: [Dbix-class] Primary key using a Sequence Generator

2008-02-09 Thread Moritz Onken
Look at DBIx::Class::UUIDColumns which overwrites the insert method. Am 08.02.2008 um 21:52 schrieb Steve Kirkup: Hello, Is there a clean way to override the insert() method to call a sequence generator for getting a primary key? I would assume it is possible, but I am unsure where it

Re: [Dbix-class] Re: A better Digest / Encoding / Encryption Component

2008-01-30 Thread Moritz Onken
You should have a look at Crypt::SaltedHash, which is used by Catalyst. There is also a Plugin called DBIx::Class::SaltedPasswords which I wrote some month ago. It's pretty simple implementation. Moritz -- Moritz Onken [EMAIL PROTECTED] Schützenstraße 81 76137 Karlsruhe Festnetz: +49 (721

[Dbix-class] Rename relationship

2008-01-26 Thread Moritz Onken
Hi, I create my schemas with the catalyst helper Catalyst::Helper::Model::DBIC::Schema. It creates all my relations correct but with pretty ugly names. I'd like to change them but don't want to remove the relations in the DBMS. Is there any easy way to achieve that? Greets, Moritz

Re: [Dbix-class] Datetime format for MySQL and SQLite

2008-01-20 Thread Moritz Onken
Have a look at http://search.cpan.org/~jshirley/DBIx-Class-TimeStamp-0.05/lib/DBIx/Class/TimeStamp.pm Am 20.01.2008 um 13:10 schrieb Fayland Lam: well, in product server I'm using MySQL and for test cases I'm using SQLite. so I wonder to ask whether there is any suggestion for something

Re: [Dbix-class] Resultset with memcached

2008-01-10 Thread Moritz Onken
I think there is no big difference in speed between the query cache of a dbms like mysql and a memcache query. Try disabling the query cache in your dbms to see the performance impact. Moritz Am 10.01.2008 um 10:48 schrieb Ash Berlin: On Jan 10, 2008, at 3:08 AM, [EMAIL PROTECTED]