__construct()
add_foreign_key()
alter_fields()
create_database()
create_index()
create_table()
drop_database()
drop_foreign_key()
drop_index()
drop_table()
field_exists()
process_foreign_keys()
rename_table()
table_exists()
table_maintenance()
truncate_table()
process_charset()
process_fields()
$_connection
$_name
__construct(string $name, $connection)
stringdatabase connection instance
add_foreign_key(string $table, array $foreign_key) : int
stringthe table name
arraya single foreign key
intnumber of affected rowsalter_fields($type, $table, $fields)
create_database(string $database, string $charset, boolean $if_not_exists) : int
Will throw a Database_Exception if it cannot.
stringthe database name
stringthe character set
booleanwhether to add an IF NOT EXISTS statement.
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowscreate_index(string $table, string $index_columns, string $index_name, string $index) : bool
| access | public |
|---|---|
| author | Thomas Edwards |
string
string
string
string(should be 'unique', 'fulltext', 'spatial' or 'nonclustered')
boolcreate_table(string $table, array $fields, array $primary_keys, boolean $if_not_exists, string | boolean $engine, string $charset, array $foreign_keys) : int
stringthe table name
arraythe fields array
arrayan array of primary keys
booleanwhether to add an IF NOT EXISTS statement.
stringbooleanstorage engine overwrite
stringdefault charset overwrite
arrayan array of foreign keys
\Database_Exception |
|---|
intnumber of affected rows.drop_database(string $database) : int
Will throw a Database_Exception if it cannot.
stringthe database name
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowsdrop_foreign_key(string $table, string $fk_name) : int
stringthe table name
stringthe foreign key name
intnumber of affected rowsdrop_index(string $table, string $index_name) : bool
drop_table(string $table) : int
Will throw a Database_Exception if it cannot.
stringthe table name
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowsfield_exists(string $table, string | array $columns) : bool
stringTable name
stringarraycolumns to check
\Database_Exception |
|---|
boolprocess_foreign_keys(array $foreign_keys) : string
arrayArray of foreign key rules
\Database_Exception |
|---|
stringthe formatted foreign key stringrename_table(string $table, string $new_table_name) : int
Will throw a Database_Exception if it cannot.
stringthe old table name
stringthe new table name
\Database_Exception |
|---|
intthe number of affectedtable_exists(string $table) : bool
stringTable name
\Database_Exception |
|---|
booltable_maintenance($operation, $table)
truncate_table(string $table) : int
stringthe table name
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowsprocess_charset(string $charset, bool $is_default, string $collation) : string
stringthe character set
boolwhether to use default
stringthe collating sequence to be used
stringthe formatted charset sqlprocess_fields($fields, $prefix)
$_name : string