Constructor
new Structure()
Methods
bigint(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'bigint' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 255 | Min 1, Max 255. Defaults to 255 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
binary(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'binary' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 1 | Length of data. Min 1 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
bit(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'bit' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 1 | Min 1, Max 64. Default to 1 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
blob(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'blob' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 65535 | Size in bytes. Min 1, Max 65535. Defaults to 65535 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
bool(name, optionsopt) → {this}
Adds a new column of data type 'bool' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
char(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'char' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 1 | Length of characters. Min 0, Max 255. Default 1 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
date(name, optionsopt) → {this}
Adds a new column of data type 'date' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
datetime(name, fspopt, optionsopt) → {this}
Adds a new column of data type 'datetime' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
fsp | Number | <optional>
| 0 | Fractional second precision. Min 0, Max 6. Defaults to 0 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
decimal(name, sizeopt, dopt, optionsopt) → {this}
Adds a new column of data type 'decimal' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 10 | Min 1, Max 65. Defaults to 10 |
d | Number | <optional>
| 0 | Double precision. Min 0. Defaults to 0. |
options | ConstraintOptions | <optional>
| | Extra constraint options |
double(name, sizeopt, dopt, optionsopt) → {this}
Adds a new column of data type 'double' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 16 | Min 1. Defaults to 16 |
d | Number | <optional>
| 8 | Double precision. Min 1. Defaults to 8 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
drop(name) → {this}
Drops (Removes) a column name
Parameters:| Name | Type | Description |
|---|
name | String | The name of the column |
enum(name, vals, optionsopt) → {this}
Adds a new column of data type 'enum' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
vals | Array.<String> | | Array of possible values |
options | ConstraintOptions | <optional>
| Extra constraint options |
float(name, popt, optionsopt) → {this}
Adds a new column of data type 'float' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
p | Number | <optional>
| 25 | Precision. Min 1, Max 53. Defaults to 25 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
Returns the columns
int(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'int' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 255 | Min 1, Max 255. Defaults to 255 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
longblob(name, optionsopt) → {this}
Adds a new column of data type 'longblob' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
longtext(name, optionsopt) → {this}
Adds a new column of data type 'longtext' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
mediumint(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'mediumint' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 255 | Min 1, Max 255. Defaults to 255 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
mediumtext(name, optionsopt) → {this}
Adds a new column of data type 'mediumtext' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
set(name, vals, optionsopt) → {this}
Adds a new column of data type 'enum' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
vals | Array.<String> | | Array of possible values |
options | ConstraintOptions | <optional>
| Extra constraint options |
smallint(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'smallint' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 255 | Min 1, Max 255. Defaults to 255 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
text(name, optionsopt) → {this}
Adds a new column of data type 'text' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
time(name, fspopt, optionsopt) → {this}
Adds a new column of data type 'time' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
fsp | Number | <optional>
| 0 | Fractional second precision. Min 0, Max 6. Defaults to 0 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
timestamp(name, fspopt, optionsopt) → {this}
Adds a new column of data type 'timestamp' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
fsp | Number | <optional>
| 0 | Fractional second precision. Min 0, Max 6. Defaults to 0 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
tinyblob(name, optionsopt) → {this}
Adds a new column of data type 'tinyblob' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
tinyint(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'tinyint' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 255 | Min 1, Max 255. Defaults to 255 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
tinytext(name, optionsopt) → {this}
Adds a new column of data type 'tinytext' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |
varbinary(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'varbinary' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 1 | Length of data. Min 1 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
varchar(name, sizeopt, optionsopt) → {this}
Adds a new column of data type 'varchar' to this structure
Parameters:| Name | Type | Attributes | Default | Description |
|---|
name | String | | | Name of the column |
size | Number | <optional>
| 8 | Length of characters. Min 0, Max 255. Default 1 |
options | ConstraintOptions | <optional>
| | Extra constraint options |
year(name, optionsopt) → {this}
Adds a new column of data type 'year' to this structure
Parameters:| Name | Type | Attributes | Description |
|---|
name | String | | Name of the column |
options | ConstraintOptions | <optional>
| Extra constraint options |