Moved some SQL parsing of ORDER BY from _select_args() to retrieve_from_sql() where...
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Storage / DBI / SQLite.pm
index dbe5ea0..e29c2ee 100644 (file)
@@ -19,7 +19,7 @@ sub backup
   $dir ||= './';
 
   ## Where is the db file?
-  my $dsn = $self->connect_info()->[0];
+  my $dsn = $self->_dbi_connect_info()->[0];
 
   my $dbname = $1 if($dsn =~ /dbname=([^;]+)/);
   if(!$dbname)
@@ -45,6 +45,20 @@ sub backup
   return $backupfile;
 }
 
+sub disconnect {
+
+  # As described in this node http://www.perlmonks.org/?node_id=666210
+  # there seems to be no sane way to ->disconnect a SQLite database with
+  # cached statement handles. As per mst we just zap the cache and 
+  # proceed as normal.
+
+  my $self = shift;
+  if ($self->connected) {
+    $self->_dbh->{CachedKids} = {};
+    $self->next::method (@_);
+  }
+}
+
 
 1;