__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)
string
database connection instance
add_foreign_key(string $table, array $foreign_key) : int
string
the table name
array
a single foreign key
int
number 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.
string
the database name
string
the character set
boolean
whether to add an IF NOT EXISTS statement.
\Fuel\Core\Fuel\Database_Exception |
---|
int
the 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')
bool
create_table(string $table, array $fields, array $primary_keys, boolean $if_not_exists, string | boolean $engine, string $charset, array $foreign_keys) : int
string
the table name
array
the fields array
array
an array of primary keys
boolean
whether to add an IF NOT EXISTS statement.
string
boolean
storage engine overwrite
string
default charset overwrite
array
an array of foreign keys
\Database_Exception |
---|
int
number of affected rows.drop_database(string $database) : int
Will throw a Database_Exception if it cannot.
string
the database name
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowsdrop_foreign_key(string $table, string $fk_name) : int
string
the table name
string
the foreign key name
int
number of affected rowsdrop_index(string $table, string $index_name) : bool
drop_table(string $table) : int
Will throw a Database_Exception if it cannot.
string
the table name
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowsfield_exists(string $table, string | array $columns) : bool
string
Table name
string
array
columns to check
\Database_Exception |
---|
bool
process_foreign_keys(array $foreign_keys) : string
array
Array of foreign key rules
\Database_Exception |
---|
string
the formatted foreign key stringrename_table(string $table, string $new_table_name) : int
Will throw a Database_Exception if it cannot.
string
the old table name
string
the new table name
\Database_Exception |
---|
int
the number of affectedtable_exists(string $table) : bool
string
Table name
\Database_Exception |
---|
bool
table_maintenance($operation, $table)
truncate_table(string $table) : int
string
the table name
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowsprocess_charset(string $charset, bool $is_default, string $collation) : string
string
the character set
bool
whether to use default
string
the collating sequence to be used
string
the formatted charset sqlprocess_fields($fields, $prefix)
$_name : string