Class: atkMysqlDDL
Source Location: /db/class.atkmysqlddl.inc
Class atkMysqlDDL
Method Summary
| The |
buildCreate() |
Build a CREATE TABLE query and return it as a string. |
| void |
buildField() |
Generate a string for a field, to be used inside a CREATE TABLE statement. |
| void |
getGenericType() |
Convert an database specific type to an ATK generic datatype. |
| void |
getType() |
Convert an ATK generic datatype to a database specific type. |
| void |
loadMetaData() |
Set all table data at once using the given table meta data, retrieved using the metadata function of the db instance. |
| void |
setTableType() |
Sets the table type (for databases that support different table types). |
Methods
Build a CREATE TABLE query and return it as a string.
API Tags:
| Return: | CREATE TABLE query. |
Redefinition of:
- atkDDL::buildCreate()
- Build a CREATE TABLE query and return it as a string.
void buildField(
string
$name, string
$generictype, [int
$size = 0], [int
$flags = 0], [mixed
$default = NULL]
)
|
|
Generate a string for a field, to be used inside a CREATE TABLE statement.
This function tries to be generic, so it will work in the largest number of databases. Databases that won't work with this syntax, should override this method in the database specific ddl class.
Parameters:
|
string |
$name: |
The name of the field |
|
string |
$generictype: |
The datatype of the field (should be one of the generic types supported by ATK). |
|
int |
$size: |
The size of the field (if appropriate) |
|
int |
$flags: |
The DDL_ flags for this field. |
|
mixed |
$default: |
The default value to be used when inserting new rows. |
Redefinition of:
- atkDDL::buildField()
- Generate a string for a field, to be used inside a CREATE TABLE statement.
boolean dropSequence(
string
$name
)
|
|
Drop sequence
Parameters:
|
string |
$name: |
Sequence name |
Redefinition of:
- atkDDL::dropSequence()
- Drop sequence
void getGenericType(
string
$type
)
|
|
Convert an database specific type to an ATK generic datatype.
Parameters:
|
string |
$type: |
The database specific datatype to convert. |
Redefinition of:
- atkDDL::getGenericType()
- Convert an database specific type to an ATK generic datatype.
Redefined in descendants as:
void getType(
string
$generictype
)
|
|
Convert an ATK generic datatype to a database specific type.
Parameters:
|
string |
$generictype: |
The datatype to convert. |
Redefinition of:
- atkDDL::getType()
- Convert an ATK generic datatype to a database specific type.
void loadMetaData(
array
$tablemeta
)
|
|
Set all table data at once using the given table meta data, retrieved using the metadata function of the db instance.
Parameters:
|
array |
$tablemeta: |
table meta data array |
Redefinition of:
- atkDDL::loadMetaData()
- Set all table data at once using the given table meta data, retrieved using the metadata function of the db instance.
boolean renameSequence(
string
$name, string
$new_name
)
|
|
Rename sequence
Parameters:
|
string |
$name: |
Sequence name |
|
string |
$new_name: |
New sequence name |
Redefinition of:
- atkDDL::renameSequence()
- Rename sequence
boolean renameTable(
string
$name, string
$new_name
)
|
|
Rename table name
Parameters:
|
string |
$name: |
Table name |
|
string |
$new_name: |
New table name |
Redefinition of:
- atkDDL::renameTable()
- Rename table name
void setTableType(
string
$type
)
|
|
Sets the table type (for databases that support different table types).
Parameters: