Dancer-Plugin-Database icon indicating copy to clipboard operation
Dancer-Plugin-Database copied to clipboard

Made named connections inherit their charset from the default(unless cha...

Open esyphelon opened this issue 10 years ago • 4 comments

Changed the way named connections apply their settings to inherit the default connection's charset.

esyphelon avatar Jan 09 '15 17:01 esyphelon

Sorry for the slow reply - this looks good, thanks! However, I'm wondering if it should be more generic, and copy everything from the top level (except the 'settings' key), as it may also be desirable for e.g. dbi_params, handle_class etc to inherit. Need to have a bit more of a think, but I'd welcome your opinions too.

@ambs what do you think also?

bigpresh avatar Jan 19 '15 09:01 bigpresh

Indeed, some more inheritance might be good. Probably we can help @esyphelon preparing the list of keys we think should be preserved?

ambs avatar Jan 19 '15 10:01 ambs

On Mon, 19 Jan 2015 02:01:05 -0800 Alberto Simões [email protected] wrote:

Indeed, some more inheritance might be good. Probably we can help @esyphelon preparing the list of keys we think should be preserved?

Off the top of my head, I would say:

  • Take a copy of the top-level plugin config; remove the 'settings' key from it;
  • From the named setting's config that has been fetched, copy every key specified in it over the top of the copy of the top-level config (overwriting any value that was at the top level with what that named setting provided)

That way, everything inherits, and future settings will automatically inherit without having to remember to add them to the list.

Does that seem to make sense? I'm only part way through my first coffee, so I may have missed something obviously stupid about the above :)

bigpresh avatar Jan 19 '15 10:01 bigpresh

It makes sense, but I haven't a coffee yet :-)

ambs avatar Jan 19 '15 10:01 ambs