ap / DBIx-Connector

Fast, safe DBI connection and transaction management
https://metacpan.org/release/DBIx-Connector
40 stars 14 forks source link

Feature Request: callback on each internal "connect()" call. #8

Closed mlawren closed 13 years ago

mlawren commented 13 years ago

At the moment I don't see a way to cause an action to occur after DBIx::Connector (re-)connects with DBI. This is needed for example if one wants to turn on foreign key support in SQLite or set client_min_messages in Pg. Have I missed something?

My API suggestion would be to accept a coderef as the fifth argument to the connect() method.

theory commented 13 years ago

You want the connected Callback!

mlawren commented 13 years ago

Ah indeed. DBI has support for this built-in... learning new things every day :-)

Thanks.

theory commented 13 years ago

Yes, well, in fairness, the feature has been there for about five years, but was only documented a few months ago…

ocharles commented 12 years ago

I just came to request this exact same issue, and couldn't find it in DBIx::Connector docs. While I understand it's not supported by DBIx::Connector itself, that's where I first ended up looking. What do you think about adding a little note about on connection callbacks being handled by DBI?

theory commented 12 years ago

@ocharles Great idea. Got a doc patch?