Source for file postgresql.php
Documentation is available at postgresql.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* PostgreSQL export driver.
* @package Joomla.Platform
* Builds the XML data for the tables to export.
* @return string An XML string
* @throws Exception if an error occurs.
$buffer[] =
'<?xml version="1.0"?>';
$buffer[] =
'<postgresqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
$buffer[] =
' <database name="">';
$buffer[] =
' </database>';
$buffer[] =
'</postgresqldump>';
* Builds the XML structure to export.
* @return array An array of XML lines (strings).
* @throws Exception if an error occurs.
foreach ($this->from as $table)
// Replace the magic prefix if found.
// Get the details columns information.
$fields =
$this->db->getTableColumns($table, false);
$keys =
$this->db->getTableKeys($table);
$sequences =
$this->db->getTableSequences($table);
$buffer[] =
' <table_structure name="' .
$table .
'">';
foreach ($sequences as $sequence)
$sequence->start_value =
null;
$buffer[] =
' <sequence Name="' .
$sequence->sequence .
'"' .
' Schema="' .
$sequence->schema .
'"' .
' Table="' .
$sequence->table .
'"' .
' Column="' .
$sequence->column .
'"' .
' Type="' .
$sequence->data_type .
'"' .
' Start_Value="' .
$sequence->start_value .
'"' .
' Min_Value="' .
$sequence->minimum_value .
'"' .
' Max_Value="' .
$sequence->maximum_value .
'"' .
' Increment="' .
$sequence->increment .
'"' .
' Cycle_option="' .
$sequence->cycle_option .
'"' .
foreach ($fields as $field)
$buffer[] =
' <field Field="' .
$field->column_name .
'"' .
' Type="' .
$field->type .
'"' .
' Null="' .
$field->null .
'"' .
(isset
($field->default) ?
' Default="' .
$field->default .
'"' :
'') .
' Comments="' .
$field->comments .
'"' .
$buffer[] =
' <key Index="' .
$key->idxName .
'"' .
' is_primary="' .
$key->isPrimary .
'"' .
' is_unique="' .
$key->isUnique .
'"' .
' Query="' .
$key->Query .
'" />';
$buffer[] =
' </table_structure>';
* Checks if all data and options are in order prior to exporting.
* @return JDatabaseExporterPostgresql Method supports chaining.
* @throws Exception if an error is encountered.
// Check if the db connector has been set.
throw
new Exception('JPLATFORM_ERROR_DATABASE_CONNECTOR_WRONG_TYPE');
// Check if the tables have been specified.
throw
new Exception('JPLATFORM_ERROR_NO_TABLES_SPECIFIED');
Documentation generated on Tue, 19 Nov 2013 15:11:09 +0100 by phpDocumentor 1.4.3