Re: [Dbix-class] Mysql / mariadb and subqueries

2021-02-24 Thread Andrew Beverley
On Mon, 22 Feb 2021 14:02:26 + Andrew Beverley wrote: > Dear list, > > In my application, DBIx::Class is generating WHERE clauses using > subqueries. With a lot of rows in the database this performs really > badly in MariaDB [1], so I'm wondering whether there is a way to &g

[Dbix-class] Mysql / mariadb and subqueries

2021-02-22 Thread Andrew Beverley
Dear list, In my application, DBIx::Class is generating WHERE clauses using subqueries. With a lot of rows in the database this performs really badly in MariaDB [1], so I'm wondering whether there is a way to get DBIx::Class to produce the equivalent queries by joins or whether there are any

Re: [Dbix-class] Joins using sub-selects

2018-10-09 Thread Andrew Beverley
On Mon, 8 Oct 2018 15:26:41 + David Cantrell wrote: > I'm having trouble figuring out how to express one of my joins in > DBIx::Class. > > The two tables involved and some relevant sample data are: > > > select * from serviceplan_price; >

Re: [Dbix-class] relationship with additional constraints?

2018-05-17 Thread Andrew Beverley
On Thu, 17 May 2018 20:25:07 + m...@shadowcat.co.uk wrote: > Surely http://p3rl.org/DBIx::Class::ParameterizedJoinHack is exactly > what's needed here - just use it on a belongs_to rel with a join_type of > left so non-matching entries are still returned, then prefetch that rel? > > (ironic

Re: [Dbix-class] relationship with additional constraints?

2018-05-17 Thread Andrew Beverley
On Thu, 17 May 2018 11:12:45 +0200 do...@united-domains.de wrote: > Is it possible to create a relationship which has, along with the > join condition, an additional constraint where the value could > somehow be passed when the search() method is called? This should answer your question:

Re: [Dbix-class] Multiple-column subqueries

2018-05-11 Thread Andrew Beverley
On Thu, 10 May 2018 18:00:41 +0100 rob...@gmail.com wrote: > It looks like the only way to use multiple-column subqueries in DBIx::Class > is to define a virtual view, e.g. the SYNOPSIS in > https://metacpan.org/pod/DBIx::Class::ResultSource Can you give an example of what you are trying to

Re: [Dbix-class] How to avoid find when create related records

2018-02-03 Thread Andrew Beverley
On Sat, 3 Feb 2018 17:05:06 +0100 Roman Daniel wrote: > When I create customer together with address and pass the adress as > hashref (which is very comfortable), the address resultset is first > searched for the values passed and only if the address is not found, > new address is created. > > Is

Re: [Dbix-class] has_one over joining table

2018-01-30 Thread Andrew Beverley
On Tue, 30 Jan 2018 09:42:26 +0100 Stuart Dodds wrote: > > You would then do something like: > > > > $town->town_people_mayor->mayor > > Hi Andy, > > Yes, that works perfectly...thank you! You're welcome! > It would have been nice to do it in one step as I wouldn't need to > change the

Re: [Dbix-class] has_one over joining table

2018-01-29 Thread Andrew Beverley
On Mon, 29 Jan 2018 12:34:14 +0100 Stuart Dodds wrote: > I have a many to many relationship over a joining table, eg. > > towns -> town_people -> people > > In some cases it is possible for there to be has_one relationships > between the two outer tables. It's a bit of a contrived example but

Re: [Dbix-class] VOTE: Relinquish firstcome rights to Peter Rabbitson

2018-01-17 Thread Andrew Beverley
On Wed, 17 Jan 2018 07:48:56 -0500 Matthew Phillips wrote: > Per the process, the proposal has now been turned to a vote. +1 ___ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN:

Re: [Dbix-class] PROPOSAL: Relinquish firstcome rights to Peter Rabbitson

2018-01-17 Thread Andrew Beverley
On Tue, 16 Jan 2018 20:31:11 -0500 Matthew Phillips wrote: > After some internal communication with DBIC team members (which spurred the > bootstrap removal that passed today), I am sending in this proposal to > enact Andrew Beverley's 2016 proposal[1] to reestablish Peter Rabbitson's > FIRSTCOME

Re: [Dbix-class] Multi-tennant application/data and dbix-class

2018-01-03 Thread Andrew Beverley
On Wed, 3 Jan 2018 20:37:58 + Aaron Trevena wrote: > I was wondering if anyone can share any success, tips and problems of > using dbix-class in a multi-tenant application. > > I'm looking at using tenant id in the main tables, Yes, that's what I do. > and thinking best approach will be to

Re: [Dbix-class] Please review my proposed CPAN Module: DBIx-Class-Schema-VersionCheck

2017-01-06 Thread Andrew Beverley
On Fri, 06 Jan 2017 Daniel Böhmer wrote: > I know of all the modules you mentioned. Personally I've decided to > go with App::DH which works fine for me. I don't know the exact differences > though. > > However, I don't get what you want to tell me. Is the purpose of my

Re: [Dbix-class] Please review my proposed CPAN Module: DBIx-Class-Schema-VersionCheck

2017-01-06 Thread Andrew Beverley
On Fri, 6 Jan 2017 "Stefan Hornburg (Racke)" wrote: > we are using DeploymentHandler for all our projects with DBIx::Class. > > I'm really fond of it, but it lacks some scripting stuff like querying > the versions and running the prepare and upgrade scripts. > > I created a module to support

Re: [Dbix-class] ★ VOTE NOW: DBIC Governance and Namespace Control ★

2016-12-05 Thread Andrew Beverley
Abstain ___ 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] PROPOSAL: Governance and sustainability

2016-11-07 Thread Andrew Beverley
Thanks for the updated governance MST. Just one comment/question from me (this is not intended to be critical because I made the previous alternate proposal, it's a genuine concern that I would like to see answered that led me to make the previous alternative proposal): > Voting Members are: > >

Re: [Dbix-class] Please don't try to start voting yet

2016-11-07 Thread Andrew Beverley
On Mon, 7 Nov 2016 21:38:13 Matt S Trout wrote: > Once we've seen and discussed both, *then* we can call the final vote. Thanks MST, that makes much more sense, much appreciated. ___ List:

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-31 Thread Andrew Beverley
On Mon, 31 Oct 2016 11:22:32 -0400 David Golden wrote: > Please read the section entitled "=== Future Plans" in this message > from Peter: > http://www.nntp.perl.org/group/perl.modules/2016/10/msg96174.html > > What I suggested was not a hypothetical "train-smash" intended to >

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-31 Thread Andrew Beverley
On Mon, 31 Oct 2016 14:18:59 Andrew Beverley <a...@andybev.com> wrote: > On Mon, 31 Oct 2016 10:12:27 -0400 David Golden <x...@xdg.me> wrote: > > So to be absolutely clear, it sounds like proposal "B" is to grant > > Peter the unilateral power initial

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-31 Thread Andrew Beverley
On Mon, 31 Oct 2016 10:12:27 -0400 David Golden wrote: > So to be absolutely clear, it sounds like proposal "B" is to grant > Peter the unilateral power initially in dispute. > > I.e. he could – on arbitrary day N after your proposal is adopted – > merge his remaining work, transfer

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-31 Thread Andrew Beverley
On Mon, 31 Oct 2016 08:39:29 -0400 David Golden <x...@xdg.me> wrote: > On Mon, Oct 31, 2016 at 7:22 AM, Andrew Beverley <a...@andybev.com> wrote: > > > - RIBASUSHI retains the current namespace > > > > > Peter previously said that he would only continue

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-31 Thread Andrew Beverley
On Mon, 31 Oct 2016 00:43:31 Matt S Trout wrote: > Otherwise, I would suggest that you turn your plan into a full > proposal, TBH, I didn't even realise I was making a proposal until I saw the results[1]. I was merely bringing up one of Dave's earlier suggestions[2], which

Re: [Dbix-class] GOVERNANCE: Aggregation and conclusion

2016-10-30 Thread Andrew Beverley
On Sat, 29 Oct 2016 20:47:20 -0400 David Golden wrote: > I'm very pleased to see how the DBIC community has engaged in honest > discussion about self-governance. It's been a long road, but one > that I think will serve the community well going forward. > > I'll make the changes in

Re: [Dbix-class] Clarification on the split-namespace proposal

2016-10-24 Thread Andrew Beverley
On Mon, 24 Oct 2016 13:40:15 +0100 Leo Lapworth wrote: > This sounds like the worst of all options. I disagree. Given the last 3 weeks of discussions, it sounds like the only option, and the one that offers a solution for everyone. > I'd rather such a key project as DBIx::Class

Re: [Dbix-class] IMPORTANT: A discussion of DBIC governance and future development

2016-10-23 Thread Andrew Beverley
On Wed, 5 Oct 2016 04:07:04 -0400 David Golden wrote: [...] > * DBIx::Class (DBIC) – Peter's work provides a capstone, with only bug > fixes thereafter > * DBIx::Class2 (DBIC2) – new feature development, with lower stability > expectations > > Some of the benefits I could see from

Re: [Dbix-class] IMPORTANT: A discussion of DBIC governance and future development

2016-10-06 Thread Andrew Beverley
I've not got much to add that hasn't already said, except that my current priority is stability and performance over feature improvements. Other than that, I would like to publicly thank Ribasushi for the huge amount of effort and dedication he has put into the project. Not just the code commits,

Re: [Dbix-class] DBIx, Postgres and Camel Case in field and table names

2015-02-23 Thread Andrew Beverley
On Mon, 2015-02-23 at 14:01 +0400, Jan Eskilsson wrote: Is there a way to make DBIx automatically quote table and field names in the generated SQL ? Yes, with the quote_names option: https://metacpan.org/pod/DBIx::Class::Storage::DBI#quote_names Regards, Andy

Re: [Dbix-class] Joining the same table several times with different conditions each join

2014-05-18 Thread Andrew Beverley
On Sat, 2014-05-17 at 10:00 -0700, Karen Etheridge wrote: On Sat, May 17, 2014 at 11:01:59AM +0100, Andrew Beverley wrote: I'd like to join the same table multiple times, with different conditions each join (and a variable number of joins). If you define each of your join permutations

[Dbix-class] Joining the same table several times with different conditions each join

2014-05-17 Thread Andrew Beverley
Dear all, I'd like to join the same table multiple times, with different conditions each join (and a variable number of joins). Equivalent SQL to something like this: SELECT record.id, s1.value AS firstname, s2.value AS surname FROM record LEFT JOIN string s1 ON

Re: [Dbix-class] Passing values to a custom join condition

2014-01-24 Thread Andrew Beverley
On Tue, 2014-01-07 at 00:24 +, Lianna Eeftinck wrote: I would do something like this, assuming you're looking for a left join: Result/Task.pm: __PACKAGE__-has_many( site_tasks, Lenio::Schema::Result::SiteTask, { 'foreign.task_id' = 'self.id' }, { join_type = 'left',

Re: [Dbix-class] Passing values to a custom join condition

2014-01-24 Thread Andrew Beverley
On Thu, 2014-01-09 at 06:56 +, Peter Rabbitson wrote: On Sun, Jan 05, 2014 at 09:44:13PM +, Andrew Beverley wrote: I'm using add_relationship to create a custom join condition, as described at https://metacpan.org/pod/DBIx::Class::Relationship::Base#condition In a similar vein

Re: [Dbix-class] Passing values to a custom join condition

2014-01-06 Thread Andrew Beverley
On Mon, 2014-01-06 at 22:22 +0100, Gerhard Jungwirth wrote: I had the same problem like you had, and as far as I know, this is not supported in custom relationships. You have a few options though. Thanks for the reply - I thought that might be the case. 1) Arbitrary SQL with a

[Dbix-class] Passing values to a custom join condition

2014-01-05 Thread Andrew Beverley
I'm using add_relationship to create a custom join condition, as described at https://metacpan.org/pod/DBIx::Class::Relationship::Base#condition In a similar vein to the example in the manual, I have created the following relationship: __PACKAGE__-has_many( site_single_tasks,

Re: [Dbix-class] Adding an additional custom join parameter

2013-12-10 Thread Andrew Beverley
On Wed, 2013-12-11 at 00:23 +0900, Hailin Hu wrote: Well, can you try this way? Have join started from site_task, like this $site_task-search( ..., join = ['site', 'task', 'issue'], ) The relationships may be like this? _SITE_TASK_-belongs_to('site' = 'Site');

Re: [Dbix-class] Adding an additional custom join parameter

2013-12-10 Thread Andrew Beverley
On Tue, 2013-12-10 at 14:13 +, Gavin Rogers wrote: You raise a valid point though, in that this is probably a poor way to design such a database. Maybe I should only have one site_task table to link the sites and tasks tables, and then have appropriate fields within that single table

Re: [Dbix-class] Adding an additional custom join parameter

2013-12-10 Thread Andrew Beverley
On Wed, 2013-12-11 at 05:54 +1100, neil.lunn wrote: On 9/12/2013 12:41 PM, Andrew Beverley wrote: My database has a table that has 2 other has many tables related to it, best described by this diagram: http://files.andybev.com/schema.png I want to select from the task table, joining

[Dbix-class] Adding an additional custom join parameter

2013-12-08 Thread Andrew Beverley
My database has a table that has 2 other has many tables related to it, best described by this diagram: http://files.andybev.com/schema.png I want to select from the task table, joining both other tables at the same time. In order for the joins to work correctly, in raw SQL I would use 2