Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.
Signature
public function getColumnDeclarationSQL(string
$name,
array
$field )
Parameters
$name
—
string
name the field to be declared.
$field
—
array
associative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:
length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS.
default Text value to be used as default for this field.
notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field. unique unique constraint check column check constraint columnDefinition a string that defines the complete column
Returns
string
DBMS specific SQL code portion that should be used to declare the column.