Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

DBIx::Class (in perl) has a connection info option that calls a method that does its best to turn all of that horrible crap off:

    sub connect_call_set_strict_mode {
      my $self = shift;

      # the @@sql_mode puts back what was previously set on the session handle
      $self->_do_query(q|SET SQL_MODE = CONCAT('ANSI,TRADITIONAL,ONLY_FULL_GROUP_BY,', @@sql_mode)|);
      $self->_do_query(q|SET SQL_AUTO_IS_NULL = 0|);
    }
Please feel free to steal it if it helps :)


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: