Open chenjch opened 10 years ago
i just modify your code at present :) $dbh->{private_dancer_plugin_database} = { log_queries => $settings->{log_queries} || 0, sql_abstract => $settings->{sql_abstract} || {}, };
Would #38 do what you need, if it was accepted?
config.yml
plugins:
Database:
handle_class: 'Mew::DBHandle'
driver: mysql
host: ...
database: ..
port: 3306
...
handle_setting:
log_queries: 1
sql_abstract:
limit_dialect: 'LimitXY'
quote_char: '`'
name_sep: '.'
Dancer::Plugin::Database::Core
$dbh->{private_dancer_plugin_database} = $settings->{handle_setting};
my own handle class Mew::DBHandle, subclass of Dancer::Plugin::Database::Core::Handle
can get the sql_abstract setting by $self->{private_dancer_plugin_database}->{sql_abstract}
and Dancer::Plugin::Database::Core::Handle can get the log_queries setting by $self->{private_dancer_plugin_database}->{log_queries}, this is my need and it looks like perfect:)
I use my own database handles, subclass from Dancer::Plugin::Database::Core::Handle, but i want to get some config setting from config.yml, such as:
at Dancer::Plugin::Database::Core, you give log_queries config to Dancer::Plugin::Database::Core::Handle, but how you give other config to my own handle