_init()
add_fields()
add_foreign_key()
analyze_table()
check_table()
create_database()
create_index()
create_table()
drop_database()
drop_fields()
drop_foreign_key()
drop_index()
drop_table()
field_exists()
modify_fields()
optimize_table()
process_foreign_keys()
rename_table()
repair_table()
set_connection()
table_exists()
truncate_table()
alter_fields()
table_maintenance()
$connection
DBUtil Class
package | Fuel |
---|---|
category | Core |
author | Dan Horrigan |
_init()
add_fields(string $table, array $fields, string $db) : int
Will throw a Database_Exception if it cannot.
string
the table name
array
the new fields
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affectedadd_foreign_key(string $table, array $foreign_key, string $db) : int
string
the table name
array
a single foreign key
string
the database connection to use
int
number of affected rowsanalyze_table(string $table, string $db) : bool
string
the table name
string
the database connection to use
bool
whether the table is OKcheck_table(string $table, string $db) : bool
string
the table name
string
the database connection to use
bool
whether the table is OKcreate_database(string $database, string $charset, boolean $if_not_exists, string $db) : 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.
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowscreate_index(string $table, string $index_columns, string $index_name, string $index, string $db) : bool
access | public |
---|---|
static | |
author | Thomas Edwards |
string
string
string
string
(should be 'unique', 'fulltext', 'spatial' or 'nonclustered')
string
the database connection to use
bool
create_table(string $table, array $fields, array $primary_keys, boolean $if_not_exists, string | boolean $engine, string $charset, array $foreign_keys, string $db) : 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
string
the database connection to use
\Database_Exception |
---|
int
number of affected rows.drop_database(string $database, string $db) : int
Will throw a Database_Exception if it cannot.
string
the database name
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowsdrop_fields(string $table, string | array $fields, string $db) : int
Will throw a Database_Exception if it cannot.
string
the table name
string
array
the fields
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affecteddrop_foreign_key(string $table, string $fk_name, string $db) : int
string
the table name
string
the foreign key name
string
the database connection to use
int
number of affected rowsdrop_index(string $table, string $index_name, string $db) : bool
access | public |
---|---|
static | |
author | Thomas Edwards |
string
string
string
the database connection to use
bool
drop_table(string $table, string $db) : int
Will throw a Database_Exception if it cannot.
string
the table name
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowsfield_exists(string $table, string | array $columns, string $db) : bool
string
Table name
string
array
columns to check
string
the database connection to use
\Database_Exception |
---|
bool
modify_fields(string $table, array $fields, string $db) : int
Will throw a Database_Exception if it cannot.
string
the table name
array
the modified fields
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affectedoptimize_table(string $table, string $db) : bool
string
the table name
string
the database connection to use
bool
whether the table has been optimizedprocess_foreign_keys(array $foreign_keys, string $db) : string
array
Array of foreign key rules
string
the database connection to use
\Database_Exception |
---|
string
the formatted foreign key stringrename_table(string $table, string $new_table_name, string $db) : int
Will throw a Database_Exception if it cannot.
string
the old table name
string
the new table name
string
the database connection to use
\Database_Exception |
---|
int
the number of affectedrepair_table(string $table, string $db) : bool
string
the table name
string
the database connection to use
bool
whether the table has been repairedset_connection(string $connection)
string
connection name, null for default
\FuelException |
---|
table_exists(string $table, string $db) : bool
string
Table name
string
the database connection to use
\Database_Exception |
---|
bool
truncate_table(string $table, string $db) : int
string
the table name
string
the database connection to use
\Fuel\Core\Fuel\Database_Exception |
---|
int
the number of affected rowsalter_fields($type, $table, $fields, $db)
table_maintenance($operation, $table, $db)
$connection : string