bigpresh / bigpresh/Dancer-Plugin-Database
how my own database handles use config.yml
- Dominant language
- Perl
- Stars
- 39
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
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:
plugins:
Database:
handle_class: 'Mew::DBHandle'
driver: mysql
host: ...
...
log_queries: 1
sql_abstract:
limit_dialect: 'LimitXY'
quote_char: '`'
name_sep: '.'
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
# Indicate whether queries generated by quick_query() etc in
# Dancer::Plugin::Database::Core::Handle should be logged or not; this seemed a
# little dirty, but DBI's docs encourage it
# ("You can stash private data into DBI handles via $h->{private_..._*}..")
$dbh->{private_dancer_plugin_database} = {
log_queries => $settings->{log_queries} || 0,
};
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading Dancer::Plugin::Database::Core and Dancer::Plugin::Database::Core::Handle, focusing on how config.yml settings reach the handle and how log_queries is stored on the DBI handle. Done means the issue's requested configuration settings can reach a custom handle subclass, with the behavior documented or demonstrated by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100