lodel
[ class tree: lodel ] [ index: lodel ] [ all elements ]

Class: ADODB2_postgres

Source Location: /lodel/scripts/adodb/datadict/datadict-postgres.inc.php

Class Overview

ADODB_DataDict
   |
   --ADODB2_postgres



Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 16]


[ Top ]


Class Variables

$addCol =  ' ADD COLUMN'

[line 21]


Type:   mixed
Overrides:   Array


[ Top ]

$databaseType =  'postgres'

[line 18]


Type:   mixed


[ Top ]

$dropTable =  'DROP TABLE %s CASCADE'

[line 24]


Type:   mixed
Overrides:   Array


[ Top ]

$quote =  '"'

[line 22]


Type:   mixed


[ Top ]

$renameTable =  'ALTER TABLE %s RENAME TO %s'

[line 23]


Type:   mixed
Overrides:   Array


[ Top ]

$seqField =  false

[line 19]


Type:   mixed


[ Top ]

$seqPrefix =  'SEQ_'

[line 20]


Type:   mixed


[ Top ]



Class Methods


method ActualType [line 90]

void ActualType( $meta)



Overrides ADODB_DataDict::ActualType() (parent method not documented)

Parameters:

   $meta  

[ Top ]

method AddColumnSQL [line 128]

array AddColumnSQL( string $tabname, string $flds)

Adding a new Column

reimplementation of the default function as postgres does NOT allow to set the default in the same statement




Tags:

return:  with SQL strings


Overrides ADODB_DataDict::AddColumnSQL() (parent method not documented)

Parameters:

string   $tabname   table-name
string   $flds   column-names and types for the changed columns

[ Top ]

method AlterColumnSQL [line 181]

array AlterColumnSQL( string $tabname, string $flds, [string $tableflds = ''], [array/ $tableoptions = ''])

Change the definition of one column

Postgres can't do that on it's own, you need to supply the complete defintion of the new table, to allow, recreating the table and copying the content over to the new table




Tags:

return:  with SQL strings


Overrides ADODB_DataDict::AlterColumnSQL() (Change the definition of one column)

Parameters:

string   $tabname   table-name
string   $flds   column-name and type for the changed column
string   $tableflds   complete defintion of the new table, eg. for postgres, default ''
array/   $tableoptions   options for the new table see CreateTableSQL, default ''

[ Top ]

method DropColumnSQL [line 247]

array DropColumnSQL( string $tabname, string $flds, [string $tableflds = ''], [array/ $tableoptions = ''])

Drop one column

Postgres < 7.3 can't do that on it's own, you need to supply the complete defintion of the new table, to allow, recreating the table and copying the content over to the new table




Tags:

return:  with SQL strings


Overrides ADODB_DataDict::DropColumnSQL() (Drop one column)

Parameters:

string   $tabname   table-name
string   $flds   column-name and type for the changed column
string   $tableflds   complete defintion of the new table, eg. for postgres, default ''
array/   $tableoptions   options for the new table see CreateTableSQL, default ''

[ Top ]

method DropIndexSQL [line 155]

void DropIndexSQL( $idxname, [ $tabname = NULL])



Overrides ADODB_DataDict::DropIndexSQL() (parent method not documented)

Parameters:

   $idxname  
   $tabname  

[ Top ]

method DropTableSQL [line 318]

void DropTableSQL( $tabname)



Overrides ADODB_DataDict::DropTableSQL() (parent method not documented)

Parameters:

   $tabname  

[ Top ]

method MetaType [line 26]

void MetaType( $t, [ $len = -1], [ $fieldobj = false])



Overrides ADODB_DataDict::MetaType() (parent method not documented)

Parameters:

   $t  
   $len  
   $fieldobj  

[ Top ]

method RenameTableSQL [line 358]

void RenameTableSQL( $tabname, $newname)



Overrides ADODB_DataDict::RenameTableSQL() (parent method not documented)

Parameters:

   $tabname  
   $newname  

[ Top ]

method _CreateSuffix [line 329]

void _CreateSuffix( $fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint)



Overrides ADODB_DataDict::_CreateSuffix() (parent method not documented)

Parameters:

   $fname  
   &$ftype  
   $fnotnull  
   $fdefault  
   $fautoinc  
   $fconstraint  

[ Top ]

method _DropAutoIncrement [line 345]

void _DropAutoIncrement( $tabname)



Overrides ADODB_DataDict::_DropAutoIncrement() (parent method not documented)

Parameters:

   $tabname  

[ Top ]

method _GetSize [line 437]

void _GetSize( $ftype, $ty, $fsize, $fprec)



Overrides ADODB_DataDict::_GetSize() (parent method not documented)

Parameters:

   $ftype  
   $ty  
   $fsize  
   $fprec  

[ Top ]

method _IndexSQL [line 405]

void _IndexSQL( $idxname, $tabname, $flds, $idxoptions)



Overrides ADODB_DataDict::_IndexSQL() (parent method not documented)

Parameters:

   $idxname  
   $tabname  
   $flds  
   $idxoptions  

[ Top ]

method _recreate_copy_table [line 272]

array _recreate_copy_table( string $tabname, string $dropflds, string $tableflds, [array/string $tableoptions = ''])

Save the content into a temp. table, drop and recreate the original table and copy the content back in

We also take care to set the values of the sequenz and recreate the indexes. All this is done in a transaction, to not loose the content of the table, if something went wrong!




Tags:

return:  with SQL strings
internal:  


Parameters:

string   $tabname   table-name
string   $dropflds   column-names to drop
string   $tableflds   complete defintion of the new table, eg. for postgres
array/string   $tableoptions   options for the new table see CreateTableSQL, default ''

[ Top ]


Documentation generated on Wed, 11 Mar 2009 10:49:42 +0100 by phpDocumentor 1.4.2