Hi all, Just messing with this module and discovered that it ignores the data_column value given in the settings. In _retrieve() - circa line 191: my $session_data = $session_object->session_data; needs to be something like: my $data_column = $self->data_column(); my $session_data = $session_object->$data_column(); Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided. (as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider). cheers, - Brendon
On 01/07/2015 02:25 AM, Brendon Oliver wrote:
Hi all,
Just messing with this module and discovered that it ignores the data_column value given in the settings.
In _retrieve() - circa line 191: my $session_data = $session_object->session_data;
needs to be something like: my $data_column = $self->data_column(); my $session_data = $session_object->$data_column();
That is obviously a mistake. Do you mind to prepare a PR to fix it?
Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided.
(as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider).
I don't think that this is even possible in Dancer 1, to use plugin in an engine. In Dancer 2, you can't use a plugin in another plugin as the plugin architecture is broken in this regard. BTW: I also started on a DBIC provider, but gave up for now. I need some more developers which are interested in fixing the plugin architecture, this problem isn't addressed yet :'( Cheers Racke -- Modern Perl, Dancer and eCommerce consulting.
On Wed, 7 Jan 2015 08:27:33 AM Stefan Hornburg wrote:
Just messing with this module and discovered that it ignores the data_column value given in the settings.> In _retrieve() - circa line 191: my $session_data = $session_object->session_data;
needs to be something like: my $data_column = $self->data_column(); my $session_data = $session_object->$data_column();
That is obviously a mistake. Do you mind to prepare a PR to fix it?
PR = problem report? sure, just point me in the right direction.
Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided.> (as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider). I don't think that this is even possible in Dancer 1, to use plugin in an engine. In Dancer 2, you can't use a plugin in another plugin as the plugin architecture is broken in this regard.
oh ok - since I'm a bit ignorant in that regard, I wasn't aware that it's not supposed to work. But the DBIC D:P:A:E provider I have does work - and what you say probably explains a warning message I see when starting the test server if I set log=core (but I haven't tried to chase that down yet).
From what you say tho, I think, D2::Session::DBIC isn't a plugin per-se (in that it doesn't inherit from D2::Plugin)?
BTW: I also started on a DBIC provider, but gave up for now.
I need some more developers which are interested in fixing the plugin architecture, this problem isn't addressed yet :'(
I'd offer to try & help, but don't really have a clue as to what might required. - Brendon
On 01/07/2015 09:03 AM, Brendon Oliver wrote:
On Wed, 7 Jan 2015 08:27:33 AM Stefan Hornburg wrote:
Just messing with this module and discovered that it ignores the data_column value given in the settings.> In _retrieve() - circa line 191: my $session_data = $session_object->session_data;
needs to be something like: my $data_column = $self->data_column(); my $session_data = $session_object->$data_column();
That is obviously a mistake. Do you mind to prepare a PR to fix it?
PR = problem report? sure, just point me in the right direction.
Github Pull Request - you clone the Git repository, fix the issue in a branch and push back to your clone. After that you can create the pull request in Github.
Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided.> (as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider). I don't think that this is even possible in Dancer 1, to use plugin in an engine. In Dancer 2, you can't use a plugin in another plugin as the plugin architecture is broken in this regard.
oh ok - since I'm a bit ignorant in that regard, I wasn't aware that it's not supposed to work. But the DBIC D:P:A:E provider I have does work - and what you say probably explains a warning message I see when starting the test server if I set log=core (but I haven't tried to chase that down yet).
The DPAE provider for DBIC works in Dancer 1, we are using that one as well.
From what you say tho, I think, D2::Session::DBIC isn't a plugin per-se (in that it doesn't inherit from D2::Plugin)?
BTW: I also started on a DBIC provider, but gave up for now.
I need some more developers which are interested in fixing the plugin architecture, this problem isn't addressed yet :'(
I'd offer to try & help, but don't really have a clue as to what might required.
Yeah, just poking the more senior developers around here 8-). Regards Racke -- Modern Perl, Dancer and eCommerce consulting.
On Wed, 7 Jan 2015 09:15:12 AM Stefan Hornburg wrote:
On 01/07/2015 09:03 AM, Brendon Oliver wrote:
On Wed, 7 Jan 2015 08:27:33 AM Stefan Hornburg wrote:
Just messing with this module and discovered that it ignores the data_column value given in the settings.>
In _retrieve() - circa line 191: my $session_data = $session_object->session_data;
needs to be something like: my $data_column = $self->data_column(); my $session_data = $session_object->$data_column();
That is obviously a mistake. Do you mind to prepare a PR to fix it?
PR = problem report? sure, just point me in the right direction.
Github Pull Request - you clone the Git repository, fix the issue in a branch and push back to your clone.
After that you can create the pull request in Github.
ah ok... I'll see what I can do. cheers, - Brendon.
On Wed, Jan 7, 2015 at 12:03 AM, Brendon Oliver <brendon.oliver@gmail.com> wrote:
On Wed, 7 Jan 2015 08:27:33 AM Stefan Hornburg wrote:
That is obviously a mistake. Do you mind to prepare a PR to fix it?
PR = problem report? sure, just point me in the right direction.
I assumed "pull request".
Sorry, just picking up on this now: On Wed, 2015-01-07 at 08:27 +0100, Stefan Hornburg (Racke) wrote:
Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided.
(as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider).
I don't think that this is even possible in Dancer 1, to use plugin in an engine. In Dancer 2, you can't use a plugin in another plugin as the plugin architecture is broken in this regard.
I've reused the DBIC plugin inside another plugin. Is this something that I shouldn't be doing? I've done this: package Dancer2::Plugin::MyPlugin; use Dancer2::Plugin; use Dancer2::Plugin::DBIC qw//; my $schema = Dancer2::Plugin::DBIC::schema; And everything works okay. Am I missing something? Andy
On Sun, 15 Feb 2015, Andrew Beverley wrote:
Sorry, just picking up on this now:
On Wed, 2015-01-07 at 08:27 +0100, Stefan Hornburg (Racke) wrote:
Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided.
(as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider).
I don't think that this is even possible in Dancer 1, to use plugin in an engine. In Dancer 2, you can't use a plugin in another plugin as the plugin architecture is broken in this regard.
I've reused the DBIC plugin inside another plugin. Is this something that I shouldn't be doing? I've done this:
package Dancer2::Plugin::MyPlugin; use Dancer2::Plugin; use Dancer2::Plugin::DBIC qw//; my $schema = Dancer2::Plugin::DBIC::schema;
And everything works okay. Am I missing something?
I also mist that until I started a plackup stand-alone app and my screen was filled with warnings... :( In Dancer2 you can not use your own keywords in plugins. my $rs = myresultset; must be: my $rs = $dsl->app->myresultset; and the plugin registering the keyword must be used in a place where it is not realy used but gets in the dsl. Your killing of the 'import' of Dancer2::Plugin is interesting. I wonder, what if I make a normal exporter to get my resultset... -- Henk /me working on https://github.com/hvoers/Dancer-Plugin2
On Wed, 2015-01-07 at 08:27 +0100, Stefan Hornburg (Racke) wrote: [...]
BTW: I also started on a DBIC provider, but gave up for now.
I need some more developers which are interested in fixing the plugin architecture, this problem isn't addressed yet :'(
Can you (or someone else) point me in the direction of where/what/how this needs fixing please? What I'm trying to achieve, is to call a registered keyword from within a plugin. In my case, that's calling the DBIC plugin "schema" keyword from within the DPAE plugin. I've passed the DSL in, but it doesn't seem to be available within the DSL anywhere. Should I be looking at adding these keywords to the DSL, or am I completely missing the point here? Thanks, Andy
On Mon, 2015-02-16 at 16:58 +0000, Andrew Beverley wrote:
On Wed, 2015-01-07 at 08:27 +0100, Stefan Hornburg (Racke) wrote: [...]
BTW: I also started on a DBIC provider, but gave up for now.
I need some more developers which are interested in fixing the plugin architecture, this problem isn't addressed yet :'(
Can you (or someone else) point me in the direction of where/what/how this needs fixing please?
Okay, I've been having a play around with ways around this. I'll start a new thread for discussion. Andy
On Wed, 2015-01-07 at 12:25 +1100, Brendon Oliver wrote:
(as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider).
I created this a while ago, which aims to "do everything", and does reuse the existing DBIC configuration: https://github.com/abeverley/libdancer2-plugin-auth-complete-perl It probably needs a lot of tidying up, and I also wanted to see if I can integrate it into Auth::Extensible, but I haven't had a chance to look at it recently. That said, it does work, and I'm using it successfully in a couple of my projects. Andy
On 01/07/2015 02:25 AM, Brendon Oliver wrote:
Hi all,
Just messing with this module and discovered that it ignores the data_column value given in the settings.
In _retrieve() - circa line 191: my $session_data = $session_object->session_data;
needs to be something like: my $data_column = $self->data_column(); my $session_data = $session_object->$data_column();
Curious too: why doesn't this module use Dancer2::Plugin::DBIC ? I'm already using DBIC elsewhere in my application and it seems silly / redundant to me to have to define the connect string in two different places in the config. Seems to me it'd be far simpler to just have the config nominate which DBIC 'schema' connection to use and simply fall back to 'default' if none is provided.
(as an aside, I'm also working on a DBIC provider for D2::Plugin::Auth::Extensible for the same reason - to reuse the existing DBIC config, but retaining the user-definable table structures as per the Database provider).
Another way to prevent redundancy of DBIC connection details is DBIx::Class::Schema::Config. Regards Racke -- Modern Perl, Dancer and eCommerce consulting.
participants (5)
-
Andrew Beverley -
Brendon Oliver -
Henk van Oers -
Stefan Hornburg (Racke) -
Yitzchak Scott-Thoennes