<% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>

FS::DBI

NAME

FS::DBI - Freeside wrapper for DBI

SYNOPSIS

  use FS::DBI;
  
  $dbh = FS::DBI->connect( @args );
  $dbh->do(
    'UPDATE table SET foo = ? WHERE bar = ?',
    undef,
    $foo, $bar
  ) or die $dbh->errstr;

See DBI

DESCRIPTION

Allow Freeside to manage how DBI is used when necessary

Legacy databases and DBD::Pg v3.0+

Breaking behavior was introduced in DBD::Pg version 3.0.0 in regards to "pg_enable_utf8" in DBD::Pg.

Some freedside databases are legacy databases with older encodings and locales. pg_enable_utf8 no longer sets client_encoding to utf8 on non-utf8 databases, causing crashes and data corruption.

FS::DBI->connect() enforces utf8 client_encoding on all DBD::Pg connections

METHODS

connect @connect_args

For usage, see "connect" in DBI

Force utf8 client_encoding on DBD::Pg connections

<% include ('/elements/footer.html' ) %>