bigpresh / bigpresh/Dancer-Plugin-Database
Wishlist: default config params
- Dominant language
- Perl
- Stars
- 39
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
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: '...'
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.