Dancer2-Plugin-Database

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    free data loss 'features', for example:

      on_connect_do: "SET SQL_MODE='TRADITIONAL'"

    (If you're not familiar with what I mean, I'm talking about the insane
    default behaviour of "hmm, this bit of data won't fit the column you're
    trying to put it in.. hmm, I know, I'll just munge it to fit, and throw
    a warning afterwards - it's not like you're relying on me to, y'know,
    store what you ask me to store". See
    http://effectivemysql.com/presentation/mysql-idiosyncrasies-that-bite/
    for just one illustration. In hindsight, I wish I'd made a sensible
    `sql_mode' a default setting, but I don't want to change that now.)

    The optional `log_queries' setting enables logging of queries generated
    by the helper functions `quick_insert' et al in
    Dancer::Plugin::Database::Core::Handle. If you enable it, generated queries
    will be logged at 'debug' level. Be aware that they will contain the
    data you're passing to/from the database, so be careful not to enable
    this option in production, where you could inadvertently log sensitive
    information.

lib/Dancer2/Plugin/Database.pm  view on Meta::CPAN

set C<SQL_MODE> to a suitable value to disable MySQL's built-in free data loss
'features', for example:

  on_connect_do: "SET SQL_MODE='TRADITIONAL'"

(If you're not familiar with what I mean, I'm talking about the insane default
behaviour of "hmm, this bit of data won't fit the column you're trying to put it
in.. hmm, I know, I'll just munge it to fit, and throw a warning afterwards -
it's not like you're relying on me to, y'know, store what you ask me to store".
See L<http://effectivemysql.com/presentation/mysql-idiosyncrasies-that-bite/> for
just one illustration.  In hindsight, I wish I'd made a sensible C<sql_mode> a
default setting, but I don't want to change that now.)

The optional C<log_queries> setting enables logging of queries generated by the
helper functions C<quick_insert> et al in L<Dancer::Plugin::Database::Core::Handle>.
If you enable it, generated queries will be logged at 'debug' level.  Be aware
that they will contain the data you're passing to/from the database, so be
careful not to enable this option in production, where you could inadvertently
log sensitive information.

If you prefer, you can also supply a pre-crafted DSN using the C<dsn> setting;



( run in 1.863 second using v1.01-cache-2.11-cpan-71847e10f99 )