[Dbix-class] Moving load_components("InflateColumn::DateTime") to base class breaks cascade delete

2017-01-16 Thread James Gilbert
Hi, I followed this recipe: https://metacpan.org/pod/distribution/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Move-Common-Startup-into-a-Base-Class but when I do this the cascading deletes for my relationships no longer work. -- The Wellcome Trust Sanger Institute is operated by Gen

[Dbix-class] SQL::Translator::Producer::Oracle turns timestamp data_type to date

2017-02-01 Thread James Gilbert
In SQL::Translator::Producer::Oracle, used to produce the CREATE TABLE statements from my DBIx::Class defined schema, two timestamp columns I have defined as data_type timestamp, eg: last_modified => { data_type => 'timestamp', }, are converted to date Oracle column types due to

Re: [Dbix-class] SQL::Translator::Producer::Oracle turns timestamp data_type to date

2017-02-01 Thread James Gilbert
Really? Comparisons of oracle DATE and TIMESTAMP column types that I've read say that DATE cannot store fractional seconds. > On 1 Feb 2017, at 17:40, Frank Carnovale wrote: > > I presume deliberate.. in Oracle, the data type called 'date' is fully > timestamp capable. -- The Wellcome Tr

Re: [Dbix-class] Applying Result's methods to the whole ResultSet

2017-04-18 Thread James Gilbert
If I was developing the schema, in addition to the relation you show, in Result::Bar I'd have: __PACKAGE__->belongs_to('foo', 'MyApp::Schema::Result::Foo', { ... }); Then search for all the bars with a particular foo (you use the name of the relation, not the table) property: foreach my $r

Re: [Dbix-class] Applying Result's methods to the whole ResultSet

2017-04-18 Thread James Gilbert
Oh, and this will work, almost. You don't need the "->all". The has_many('bars') relation creates a 'bars' method on each Foo Result object: foreach my $r_bar (map { $_->bars } $rs_foo->all) { $r_bar->some_method; } For speed, prefetch bars. > On 18 Apr 2017, at 16:59, Vladimir Melnik

Re: [Dbix-class] How to deal with right joins while under test/sqlite

2017-11-07 Thread James Gilbert
Indeed. I've never used a right or full join. Only ever an inner or left. James > On 7 Nov 2017, at 19:28, Trevor Leffler wrote: > > Well… nevermind this. A little searching reminding me that I can replace > right join queries with left join queries (and vice versa). I’ve replaced my

Re: [Dbix-class] Result->id

2017-11-29 Thread James Gilbert
I always give my id columns a longer name incorporating the entity, such as "id_person". If you only call them "id", you will have many tables with column "id", making it hard to see how the tables are supposed to link together when looking at the schema. James > On 29 Nov 2017, at 1

[Dbix-class] Unmet DBIx::Class::Optional::Dependencies not fatal

2018-04-26 Thread James Gilbert
Hi, I just upgraded my perl to 5.26.2, DBIx::Class 0.82.841 My DBIx::Class code using an Oracle database then failed because it was making SQL where instead of a table alias, e.g. "display_status", was inserting the string "_SHORTEN_IDENTIFIER DISPLAY_STATUS". The "_shorten_identifer" method

Re: [Dbix-class] Unmet DBIx::Class::Optional::Dependencies not fatal

2019-06-11 Thread James Gilbert
Doing a new installation, just ran into this again. Perl v5.26.1 and DBIx::Class 0.082.840 this time. James > On 26 Apr 2018, at 17:44, James Gilbert wrote: > > > Hi, > > I just upgraded my perl to 5.26.2, DBIx::Class 0.82.841 > > My DBIx::Class code using

Re: [Dbix-class] What is the actual problem with component load order and how to fix it? [EXT]

2021-01-17 Thread James Gilbert
What are the column definitions in the tables? Are they the same? It may fail depending on what the default values for the columns are and if they can be null. James On 16 Jan 2021, at 22:32, Daniel Böhmer mailto:p...@daniel-boehmer.de>> wrote: At the bottom of this email you'll find a test