_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.
stringthe table name
arraythe new fields
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affectedadd_foreign_key(string $table, array $foreign_key, string $db) : int
stringthe table name
arraya single foreign key
stringthe database connection to use
intnumber of affected rowsanalyze_table(string $table, string $db) : bool
stringthe table name
stringthe database connection to use
boolwhether the table is OKcheck_table(string $table, string $db) : bool
stringthe table name
stringthe database connection to use
boolwhether the table is OKcreate_database(string $database, string $charset, boolean $if_not_exists, string $db) : int
Will throw a Database_Exception if it cannot.
stringthe database name
stringthe character set
booleanwhether to add an IF NOT EXISTS statement.
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe 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')
stringthe database connection to use
boolcreate_table(string $table, array $fields, array $primary_keys, boolean $if_not_exists, string | boolean $engine, string $charset, array $foreign_keys, string $db) : 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
stringthe database connection to use
\Database_Exception |
|---|
intnumber of affected rows.drop_database(string $database, string $db) : int
Will throw a Database_Exception if it cannot.
stringthe database name
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowsdrop_fields(string $table, string | array $fields, string $db) : int
Will throw a Database_Exception if it cannot.
stringthe table name
stringarraythe fields
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affecteddrop_foreign_key(string $table, string $fk_name, string $db) : int
stringthe table name
stringthe foreign key name
stringthe database connection to use
intnumber of affected rowsdrop_index(string $table, string $index_name, string $db) : bool
| access | public |
|---|---|
| static | |
| author | Thomas Edwards |
string
string
stringthe database connection to use
booldrop_table(string $table, string $db) : int
Will throw a Database_Exception if it cannot.
stringthe table name
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowsfield_exists(string $table, string | array $columns, string $db) : bool
stringTable name
stringarraycolumns to check
stringthe database connection to use
\Database_Exception |
|---|
boolmodify_fields(string $table, array $fields, string $db) : int
Will throw a Database_Exception if it cannot.
stringthe table name
arraythe modified fields
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affectedoptimize_table(string $table, string $db) : bool
stringthe table name
stringthe database connection to use
boolwhether the table has been optimizedprocess_foreign_keys(array $foreign_keys, string $db) : string
arrayArray of foreign key rules
stringthe database connection to use
\Database_Exception |
|---|
stringthe formatted foreign key stringrename_table(string $table, string $new_table_name, string $db) : int
Will throw a Database_Exception if it cannot.
stringthe old table name
stringthe new table name
stringthe database connection to use
\Database_Exception |
|---|
intthe number of affectedrepair_table(string $table, string $db) : bool
stringthe table name
stringthe database connection to use
boolwhether the table has been repairedset_connection(string $connection)
stringconnection name, null for default
\FuelException |
|---|
table_exists(string $table, string $db) : bool
stringTable name
stringthe database connection to use
\Database_Exception |
|---|
booltruncate_table(string $table, string $db) : int
stringthe table name
stringthe database connection to use
\Fuel\Core\Fuel\Database_Exception |
|---|
intthe number of affected rowsalter_fields($type, $table, $fields, $db)
table_maintenance($operation, $table, $db)
$connection : string