databases.php
You can manually set the databases, tables and columns that you want to use. You just need to edit the following file:
config\databases.php
Structure
//==================================================================================================
// DATABASES
//==================================================================================================
$_databases = array(
'car-shop@localhost:3306' => array(
'label' => 'CAR SHOP', // A label that you can quickly identify the database.
'name' => 'car-shop', // Database name.
'server' => 'localhost', // Database server.
'username' => 'root', // Database username.
'password' => '', // Database password.
'port' => '3306', // Database port.
'encoding' => 'utf8', // Database encoding.
'active' => true, // If the database is visible in the application.
'tables' => array(
'clients' => array(
'label' => 'clients', // A label that you can quickly identify the table.
'active' => true, // If the table is visible in the application.
'properties' => array(
array(
'name' => 'clients', // Table name.
'columns' => '*' // Columns used - '*' to use all or array with columns options.
)
)
),
'products' => array(
'label' => 'Products',
'active' => true,
'properties' => array(
array(
'name' => 'products',
'columns' => array(
array(
'label' => 'ID', // A label that you can quickly identify the column.
'name' => 'id_product', // Columns name.
'active' => true // If the column is visible in the application.
),
array(
'label' => 'Name',
'name' => 'name2',
'active' => true
)
)
)
)
),
'coupons' => array(
'label' => 'coupons',
'active' => true,
'properties' => array(
array(
'name' => 'coupons',
'columns' => '*',
'hide_columns' => array('id_coupon') // To hide specific columns array('id_coupon','status'), not a string.
)
)
)
)
),
'other' => array(
'label' => 'OTHER', // A label so you can quickly identify the database.
'name' => 'car-shop-2', // Database name.
'server' => '49.123.45.69', // Database server.
'username' => 'db_user', // Database username.
'password' => 'js#djh3$s', // Database password.
// port - Since the default port value is 3306, you can comment this line and the database port will be 3306 automatically.
// encoding - Since the default encoding is utf8, you can comment this line and the database encoding will be utf8.
// active - Since the default active value is true, you can comment this line and it will also show the database.
// tables - Since the default table value is '*', you can comment this line and it will show all the tables of the database.
),
'shortest_possible' => array(
'name' => 'car-shop-3', // Database name.
'server' => '49.123.45.69', // Database server.
'username' => 'db_user', // Database username.
'password' => 'js#djh3$s', // Database password.
)
);
Attention! All the indexes of the array are ids, so they have to be unique at the same level.
For instance, all databases must have different indexes. But different databases can have a same table index.
Database options
Name |
Type |
Default |
Description |
label |
string |
|
A label that you can quickly identify the database. |
name |
string |
|
Database name. |
server |
string |
|
Database server. |
username |
string |
|
Database username. |
password |
string |
|
Database password. |
port |
integer |
3306 |
Database port. |
encoding |
string |
utf8 |
Database encoding. |
active |
boolean |
true |
If the database is visible in the application. |
tables |
string | array |
'*' |
'*' will select all tables of the database | Array with the table options. |
Table options
Name |
Type |
Default |
Description |
label |
string |
|
A label that you can quickly identify the table. Shown in the selectbox of a import or export. |
active |
boolean |
true |
If the table is visible in the application. |
properties |
array |
|
Array with the table properties options. |
Table properties options
Name |
Type |
Default |
Description |
name |
string |
|
Table name. |
hide_columns |
array |
array() |
To hide specific columns array('id_coupon','status'). |
columns |
string | array |
'*' |
'*' will select all columns of the table | Array with the columns options. |
Columns options
Name |
Type |
Default |
Description |
label |
string |
|
A label that you can quickly identify the column. Shown in the selectboxes of a import or export. |
name |
string |
|
Column name. |
active |
boolean |
true |
If the column is visible in the application. |