Implement backup_structure method for SQLite driver
This commit is contained in:
parent
dec1a1714f
commit
4a65be4791
@ -149,8 +149,21 @@ SQL;
|
||||
*/
|
||||
public function backup_structure()
|
||||
{
|
||||
// @todo Implement Backup function
|
||||
return '';
|
||||
// Fairly easy for SQLite...just query the master table
|
||||
$sql = 'SELECT "sql" FROM "sqlite_master"';
|
||||
$res = $this->query($sql);
|
||||
$result = $res->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$sql_array = array();
|
||||
|
||||
foreach($result as $r)
|
||||
{
|
||||
$sql_array[] = $r['sql'];
|
||||
}
|
||||
|
||||
$sql_structure = implode("\n\n", $sql_array);
|
||||
|
||||
return $sql_structure;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user