PgsqlImporter

Extends DatabaseImporter

PDO PostgreSQL Database Importer.

since

1.5.0

package

Joomla Framework

Methods

__construct

Constructor.

__construct() : 
inherited

Sets up the default options for the importer.

since

1.0

Response

mixed

asXml

Set the output option for the importer to XML format.

asXml() : 
inherited
since

1.0

Response

$this

check

Checks if all data and options are in order prior to exporting.

check() : 
since

1.5.0

throws

RuntimeExceptionif an error is encountered.

Response

$this

from

Specifies the data source to import.

from(\SimpleXMLElement|string from) : 
inherited
since

1.0

Arguments

from

SimpleXMLElement|stringThe data source to import, either as a SimpleXMLElement object or XML string.

Response

$this

getAddColumnSql

Get the SQL syntax to add a column.

getAddColumnSql( table, \SimpleXMLElement field) : 
inherited
since

1.0

Arguments

table

stringThe table name.

field

SimpleXMLElementThe XML field definition.

Response

string

getAddIndexSql

Get the SQL syntax to add an index.

getAddIndexSql(\SimpleXMLElement field) : 
since

1.0

Arguments

field

SimpleXMLElementThe XML index definition.

Response

string

getAddSequenceSql

Get the syntax to add a sequence.

getAddSequenceSql(\SimpleXMLElement field) : 
since

1.0

Arguments

field

SimpleXMLElementThe XML definition for the sequence.

Response

string

getAddUniqueSql

Get the SQL syntax to add a unique constraint for a table key.

getAddUniqueSql( table, mixed||string|int key) : 
since

2.0.0

Arguments

table

stringThe table name.

key

array<string|int, mixed>The key.

Response

string

getAlterColumnSql

Get the SQL syntax for a single column that would be included in a table create statement.

getAlterColumnSql( table, \SimpleXMLElement field) : 
since

1.0

Arguments

table

stringThe name of the database table to alter.

field

SimpleXMLElementThe XML field definition.

Response

string

getAlterTableSql

Get alters for table if there is a difference.

getAlterTableSql(\SimpleXMLElement structure) : mixed||string|int
since

1.0

Arguments

structure

SimpleXMLElementThe XML structure of the table.

Response

array<string|int, mixed>

getChangeColumnSql

Get the syntax to alter a column.

getChangeColumnSql( table, \SimpleXMLElement field) : 
since

1.0

Arguments

table

stringThe name of the database table to alter.

field

SimpleXMLElementThe XML definition for the field.

Response

string

getChangeSequenceSql

Get the syntax to alter a sequence.

getChangeSequenceSql(\SimpleXMLElement field) : 
since

1.0

Arguments

field

SimpleXMLElementThe XML definition for the sequence.

Response

string

getColumnSql

Get the SQL syntax for a single column that would be included in a table create statement.

getColumnSql(\SimpleXMLElement field) : 
since

1.0

Arguments

field

SimpleXMLElementThe XML field definition.

Response

string

getDropColumnSql

Get the SQL syntax to drop a column.

getDropColumnSql( table,  name) : 
inherited
since

1.0

Arguments

table

stringThe table name.

name

stringThe name of the field to drop.

Response

string

getDropIndexSql

Get the SQL syntax to drop an index.

getDropIndexSql( name) : 
since

1.0

Arguments

name

stringThe name of the key to drop.

Response

string

getDropPrimaryKeySql

Get the SQL syntax to drop a key.

getDropPrimaryKeySql( table,  name) : 
since

1.0

Arguments

table

stringThe table name.

name

stringThe constraint name.

Response

string

getDropSequenceSql

Get the SQL syntax to drop a sequence.

getDropSequenceSql( name) : 
since

1.0

Arguments

name

stringThe name of the sequence to drop.

Response

string

getKeyLookup

Get the details list of keys for a table.

getKeyLookup(mixed||string|int keys) : mixed||string|int
since

1.2.0

Arguments

keys

array<string|int, mixed>An array of objects that comprise the keys for the table.

Response

array<string|int, mixed>The lookup array. array({key name} => array(object, ...))

getRealTableName

Get the real name of the table, converting the prefix wildcard string if present.

getRealTableName( table) : 
inherited
since

1.0

Arguments

table

stringThe name of the table.

Response

stringThe real name of the table.

getSeqLookup

Get the details list of sequences for a table.

getSeqLookup(mixed||string|int sequences) : mixed||string|int
since

1.0

Arguments

sequences

array<string|int, mixed>An array of objects that comprise the sequences for the table.

Response

array<string|int, mixed>The lookup array. array({key name} => array(object, ...))

getSetvalSequenceSql

Get the syntax to setval a sequence.

getSetvalSequenceSql(\SimpleXMLElement field) : 
since

2.0.0

Arguments

field

SimpleXMLElementThe XML definition for the sequence.

Response

string

importData

Import the data from the source into the existing tables.

importData() : 
inherited
note

Currently only supports XML format.

since

2.0.0

throws

RuntimeExceptionon error.

Response

void

mergeStructure

Merges the incoming structure definition with the existing structure.

mergeStructure() : 
inherited
note

Currently only supports XML format.

since

1.0

throws

RuntimeExceptionon error.

Response

void

setDbo

Sets the database connector to use for exporting structure and/or data.

setDbo(\Joomla\Database\DatabaseInterface db) : 
inherited
since

1.0

Arguments

db

DatabaseInterfaceThe database connector.

Response

$this

withStructure

Sets an internal option to merge the structure based on the input data.

withStructure( setting = true) : 
inherited
since

1.0

Arguments

setting

boolTrue to import the structure, false to not.

Response

$this

xmlToCreate

Get the SQL syntax to add a table.

xmlToCreate(\SimpleXMLElement table) : 
since

2.0.0

throws

RuntimeException

Arguments

table

SimpleXMLElementThe table information.

Response

string

Properties

cache

An array of cached data.

inherited
since

1.0

Type(s)

array<string|int, mixed>

db

The database connector to use for exporting structure and/or data.

since

1.0

Type(s)

PgsqlDriver

from

The input source.

inherited
since

1.0

Type(s)

mixed

asFormat

The type of input format.

inherited
since

1.0

Type(s)

string

options

An array of options for the exporter.

inherited
since

1.0

Type(s)

stdClass