bigpresh/Dancer-Plugin-Database — Issue #25: Wishlist: default config params
Author: knutov
Created: 2012-02-11 00:56:39+00:00
State: open

part of the real config:

```yaml
plugins:
Database:
handle_class: 'Dancer::Plugin::Database::KISS'
driver: 'mysql'
database: '...'
host: '...'
port: 3306
username: '...'
password: '..'
connection_check_threshold: 300
dbi_params:
RaiseError: 1
AutoCommit: 1
mysql_auto_reconnect: 1
mysql_enable_utf8: 1
on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ]
log_queries: 1
connections:
one:
handle_class: 'Dancer::Plugin::Database::KISS'
driver: 'mysql'
database: '...'
host: '...'
port: 3306
username: '...'
password: '...'
connection_check_threshold: 300
dbi_params:
RaiseError: 1
AutoCommit: 1
mysql_auto_reconnect: 1
mysql_enable_utf8: 1
on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ]
log_queries: 1
two:
handle_class: 'Dancer::Plugin::Database::KISS'
driver: 'mysql'
database: '...'
host: '...'
port: 3306
username: '...'
password: '...'
connection_check_threshold: 300
dbi_params:
RaiseError: 1
AutoCommit: 1
mysql_auto_reconnect: 1
mysql_enable_utf8: 1
on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ]
log_queries: 1
three:
handle_class: 'Dancer::Plugin::Database::KISS'
driver: 'mysql'
database: '...'
host: '...'
port: 3306
username: '...'
password: '...'
connection_check_threshold: 300
dbi_params:
RaiseError: 1
AutoCommit: 1
mysql_auto_reconnect: 1
mysql_enable_utf8: 1
on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ]
log_queries: 1
```
Not good. Not readable. A lot of duplicated characters.

May be it's better to make `default:` section in config like this?

```yaml
plugins:
Database:
database: '...'
host: '...'
username: '...'
password: '..'
default:
handle_class: 'Dancer::Plugin::Database::KISS'
driver: 'mysql'
port: 3306
connection_check_threshold: 300
dbi_params:
RaiseError: 1
AutoCommit: 1
mysql_auto_reconnect: 1
mysql_enable_utf8: 1
on_connect_do: ["SET NAMES 'utf8'", "SET CHARACTER SET 'utf8'" ]
log_queries: 1
connections:
one:
database: '...'
host: '...'
username: '...'
password: '...'
two:
database: '...'
host: '...'
username: '...'
password: '...'
three:
database: '...'
host: '...'
username: '...'
password: '...'
```