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

Class: MDB_Manager_mssql

Source Location: /MDB-1.3.0/MDB/Modules/Manager/mssql.php

Class Overview

MDB_Manager_Common
   |
   --MDB_Manager_mssql

MDB MSSQL driver for the management modules


Author(s):

  • Frank M. Kromann <frank at kromann.info

Methods


Inherited Variables

Inherited Methods


Class Details

[line 61]
MDB MSSQL driver for the management modules
  • Author: Frank M. Kromann <frank@kromann.info


[ Top ]


Method Detail

alterTable   [line 197]

mixed alterTable( mixed &$db, string $name, array $changes, boolean $check, object $dbs)

alter an existing table
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs     database object that is extended by this class
string   $name     name of the table that is intended to be changed.
array   $changes     

associative array that contains the details of each type of change that is intended to be performed. The types of changes that are currently supported are defined as follows:

name

New name for the table.

AddedFields

Associative array with the names of fields to be added as indexes of the array. The value of each entry of the array should be set to another associative array with the properties of the fields to be added. The properties of the fields should be the same as defined by the Metabase parser.

Additionally, there should be an entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement.

RemovedFields

Associative array with the names of fields to be removed as indexes of the array. Currently the values assigned to each entry are ignored. An empty array should be used for future compatibility.

RenamedFields

Associative array with the names of fields to be renamed as indexes of the array. The value of each entry of the array should be set to another associative array with the entry named name with the new field name and the entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement.

ChangedFields

Associative array with the names of the fields to be changed as indexes of the array. Keep in mind that if it is intended to change either the name of a field and any other properties, the ChangedFields array entries should have the new names of the fields as array indexes.

The value of each entry of the array should be set to another associative array with the properties of the fields to that are meant to be changed as array entries. These entries should be assigned to the new values of the respective properties. The properties of the fields should be the same as defined by the Metabase parser.

If the default property is meant to be added, removed or changed, there should also be an entry with index ChangedDefault assigned to 1. Similarly, if the notnull constraint is to be added or removed, there should also be an entry with index ChangedNotNull assigned to 1.

Additionally, there should be an entry named Declaration that is expected to contain the portion of the field changed declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement. Example array( 'name' => 'userlist', 'AddedFields' => array( 'quota' => array( 'type' => 'integer', 'unsigned' => 1 'Declaration' => 'quota INT' ) ), 'RemovedFields' => array( 'file_limit' => array(), 'time_limit' => array() ), 'ChangedFields' => array( 'gender' => array( 'default' => 'M', 'ChangeDefault' => 1, 'Declaration' => "gender CHAR(1) DEFAULT 'M'" ) ), 'RenamedFields' => array( 'sex' => array( 'name' => 'gender', 'Declaration' => "gender CHAR(1) DEFAULT 'M'" ) ) )

boolean   $check     indicates whether the function should just check if the DBMS driver can perform the requested table alterations if the value is true or actually perform them otherwise.

[ Top ]

createDatabase   [line 74]

mixed createDatabase( mixed &$db, string $name, object $dbs)

create a new database
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs     database object that is extended by this class
string   $name     name of the database that should be created

[ Top ]

createSequence   [line 469]

mixed createSequence( mixed &$db, string $seq_name, string $start, object $dbs)

create sequence
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs     database object that is extended by this class
string   $seq_name     name of the sequence to be created
string   $start     start value of the sequence; default is 1

[ Top ]

dropDatabase   [line 92]

mixed dropDatabase( mixed &$db, string $name, object $dbs)

drop an existing database
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs     database object that is extended by this class
string   $name     name of the database that should be dropped

[ Top ]

dropSequence   [line 487]

mixed dropSequence( mixed &$db, string $seq_name, object $dbs)

drop existing sequence
  • Return: MDB_OK on success, a MDB error on failure
  • Access: public

Parameters:

object   $dbs     database object that is extended by this class
string   $seq_name     name of the sequence to be dropped

[ Top ]

getTableFieldDefinition   [line 310]

mixed getTableFieldDefinition( object &$db, string $table, string $field_name)

get the stucture of a field into an array; this method is still alpha quality!
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $db     database object that is extended by this class
string   $table     name of table that should be used in method
string   $field_name     name of field that should be used in method

[ Top ]

listTableFields   [line 284]

mixed listTableFields( object &$db, string $table)

list all fields in a tables in the current database
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $db     database object that is extended by this class
string   $table     name of table that should be used in method

[ Top ]

listTables   [line 257]

mixed listTables( object &$db)

list all tables in the current database
  • Return: data array on success, a MDB error on failure
  • Access: public

Parameters:

object   $db     database object that is extended by this class

[ Top ]


Documentation generated on Sun, 16 May 2004 05:23:44 -0400 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.