├── .gitignore ├── README.md ├── composer.json └── src ├── Commands ├── AbstractCommand.php ├── Create.php ├── Delete.php ├── DeleteTable.php ├── ListAll.php ├── Query.php ├── Show.php └── ShowTable.php └── Language ├── en └── DB.php └── pt-BR └── DB.php /.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !README.md 4 | !composer.json 5 | !src/ 6 | !src/Commands/ 7 | !src/Commands/* 8 | !src/Language/ 9 | !src/Language/*/ 10 | !src/Language/*/DB.php 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | Installation is best done via Composer. Assuming Composer is installed globally, you may use the following command: 3 | 4 | > composer require natanfelles/codeigniter-db 5 | 6 | # Database Commands for CodeIgniter 4 7 | 8 | Adds the following commands to the *Database* group: 9 | 10 | Command | Description 11 | --------------- | -------------------------------- 12 | db:create | Creates a database 13 | db:delete | Deletes a database 14 | db:delete_table | Deletes a database table 15 | db:list | Lists databases 16 | db:query | Executes a SQL query 17 | db:show | Shows databases information 18 | db:show_table | Shows a database table structure 19 | 20 | ### Preview 21 | 22 | ![Image of Database Commands for CodeIgniter 4](https://natanfelles.github.io/assets/img_posts/codeigniter-db.png) 23 | 24 | ### Configuration 25 | 26 | Map the `NatanFelles\CodeIgniter\DB` namespace to the *src* folder of this project. 27 | 28 | For example: 29 | 30 | Open the *app/Config/Autoload.php* file and add a `$psr4` index like this: 31 | 32 | ```php 33 | $psr4['NatanFelles\CodeIgniter\DB'] = ROOTPATH . 'codeigniter-db/src'; 34 | ``` 35 | 36 | ### Contribute 37 | 38 | Any contribution related to bugs or improvements of this project will be very well accepted. 39 | 40 | If you can, consider a donation: 41 | 42 | [![Paypal donation](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2EYQMLYN8GSU6) 43 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "natanfelles/codeigniter-db", 3 | "description": "Database Commands for CodeIgniter 4", 4 | "keywords": [ 5 | "codeigniter", 6 | "codeigniter4", 7 | "spark", 8 | "cli", 9 | "command-line", 10 | "database", 11 | "mysql", 12 | "mariadb" 13 | ], 14 | "type": "codeigniter-command", 15 | "license": "MIT", 16 | "homepage": "https://github.com/natanfelles/codeigniter-db", 17 | "support": { 18 | "issues": "https://github.com/natanfelles/codeigniter-db/issues", 19 | "source": "https://github.com/natanfelles/codeigniter-db" 20 | }, 21 | "autoload": { 22 | "psr-4": { 23 | "NatanFelles\\CodeIgniter\\DB\\": "src/" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Commands/AbstractCommand.php: -------------------------------------------------------------------------------- 1 | description) 33 | { 34 | $this->description = lang($this->description); 35 | } 36 | 37 | if ($this->arguments) 38 | { 39 | foreach ($this->arguments as &$argument) 40 | { 41 | $argument = lang($argument); 42 | } 43 | } 44 | } 45 | 46 | protected function setDatabaseGroup() 47 | { 48 | $this->databaseGroup = CLI::getOption('group') ?? config('Database')->defaultGroup; 49 | } 50 | 51 | protected function getDatabaseGroup(): string 52 | { 53 | if ( ! $this->databaseGroup) 54 | { 55 | $this->setDatabaseGroup(); 56 | } 57 | 58 | return $this->databaseGroup; 59 | } 60 | 61 | public function __get(string $key) 62 | { 63 | if ($key === 'db' && ! isset($this->db)) 64 | { 65 | return $this->db = Database::connect($this->getDatabaseGroup()); 66 | } 67 | elseif ($key === 'forge' && ! isset($this->forge)) 68 | { 69 | return $this->db = Database::forge($this->getDatabaseGroup()); 70 | } 71 | 72 | return parent::__get($key); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/Commands/Create.php: -------------------------------------------------------------------------------- 1 | 'DB.databaseName', 21 | ]; 22 | 23 | public function run(array $params) 24 | { 25 | $database = array_shift($params); 26 | 27 | if (empty($database)) 28 | { 29 | $database = CLI::prompt(lang('DB.databaseName'), null, 'regex_match[\w.]'); 30 | } 31 | 32 | $show = $this->db->query('SHOW DATABASES LIKE :database:', [ 33 | 'database' => $database, 34 | ])->getRowArray(); 35 | 36 | if ($show) 37 | { 38 | CLI::beep(); 39 | CLI::error(lang('DB.databaseExists', [$database])); 40 | 41 | return; 42 | } 43 | 44 | $result = $this->forge->createDatabase($database); 45 | 46 | if ($result) 47 | { 48 | CLI::write(lang('DB.databaseCreated', [$database]), 'green'); 49 | 50 | return; 51 | } 52 | 53 | CLI::error(lang('DB.databaseNotCreated', [$database])); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/Commands/Delete.php: -------------------------------------------------------------------------------- 1 | 'DB.databaseName', 20 | ]; 21 | 22 | public function run(array $params) 23 | { 24 | $database = array_shift($params); 25 | 26 | if (empty($database)) 27 | { 28 | $database = CLI::prompt(lang('DB.databaseName'), null, 'regex_match[\w.]'); 29 | } 30 | 31 | $show = $this->db->query('SHOW DATABASES LIKE :database:', [ 32 | 'database' => $database, 33 | ])->getRowArray(); 34 | 35 | if (empty($show)) 36 | { 37 | CLI::beep(); 38 | CLI::error(lang('DB.databaseNotExists', [$database])); 39 | 40 | return; 41 | } 42 | 43 | $result = $this->forge->dropDatabase($database); 44 | 45 | if ($result) 46 | { 47 | CLI::write(lang('DB.databaseDeleted', [$database]), 'green'); 48 | 49 | return; 50 | } 51 | 52 | CLI::error(lang('DB.databaseNotDeleted', [$database])); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Commands/DeleteTable.php: -------------------------------------------------------------------------------- 1 | 'DB.tableName', 20 | ]; 21 | 22 | public function run(array $params) 23 | { 24 | $table = array_shift($params); 25 | 26 | if (empty($table)) 27 | { 28 | $table = CLI::prompt(lang('DB.tableName'), null, 'regex_match[\w.]'); 29 | } 30 | 31 | if (strpos($table, '.') !== false) 32 | { 33 | [$database, $table] = explode('.', $table, 2); 34 | 35 | $this->db->setDatabase($database); 36 | } 37 | 38 | $show = $this->db->query('SHOW TABLES LIKE :table:', [ 39 | 'table' => $table, 40 | ])->getRowArray(); 41 | 42 | if (empty($show)) 43 | { 44 | CLI::beep(); 45 | CLI::error(lang('DB.tableNotExists', [$table])); 46 | 47 | return; 48 | } 49 | 50 | $result = $this->forge->dropTable($table); 51 | 52 | if ($result) 53 | { 54 | CLI::write(lang('DB.tableDeleted', [$table]), 'green'); 55 | 56 | return; 57 | } 58 | 59 | CLI::error(lang('DB.tableNotDeleted', [$table])); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/Commands/ListAll.php: -------------------------------------------------------------------------------- 1 | db->query($sql)->getResultArray(); 26 | 27 | if ( ! $databases) 28 | { 29 | CLI::write(lang('DB.noDatabases')); 30 | 31 | return; 32 | } 33 | 34 | $sql = 'SELECT TABLE_SCHEMA AS "database", 35 | SUM(DATA_LENGTH + INDEX_LENGTH) AS "size", 36 | COUNT(DISTINCT CONCAT(TABLE_SCHEMA, ".", TABLE_NAME)) AS "tables" 37 | FROM information_schema.TABLES 38 | GROUP BY TABLE_SCHEMA'; 39 | 40 | $infos = $this->db->query($sql)->getResultArray(); 41 | 42 | helper('number'); 43 | 44 | foreach ($databases as &$database) 45 | { 46 | $database['size'] = $database['tables'] = 0; 47 | 48 | foreach ($infos as $info) 49 | { 50 | if ($info['database'] === $database['database']) 51 | { 52 | $database['tables'] = $info['tables']; 53 | $database['size'] = number_to_size($info['size']); 54 | break; 55 | } 56 | } 57 | } 58 | 59 | CLI::table($databases, [ 60 | lang('DB.database'), 61 | lang('DB.collation'), 62 | lang('DB.tables'), 63 | lang('DB.size'), 64 | ]); 65 | 66 | CLI::write(lang('DB.total') . ': ' . count($databases)); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/Commands/Query.php: -------------------------------------------------------------------------------- 1 | 'DB.queryToExecute', 21 | ]; 22 | 23 | public function run(array $params) 24 | { 25 | $query = array_shift($params); 26 | 27 | if (empty($query)) 28 | { 29 | $query = CLI::prompt(lang('DB.query'), null, 'required'); 30 | } 31 | 32 | CLI::write( 33 | CLI::color(lang('DB.query') . ': ', 'white') . CLI::color($query, 'yellow') 34 | ); 35 | 36 | try 37 | { 38 | $result = $this->db->query($query); 39 | } 40 | catch (\Exception $e) 41 | { 42 | CLI::beep(); 43 | CLI::error($e->getMessage()); 44 | 45 | return; 46 | } 47 | 48 | if ($this->db->getLastQuery()->isWriteType()) 49 | { 50 | CLI::write(lang('DB.affectedRows', [$this->db->affectedRows()])); 51 | 52 | if ($this->db->insertID()) 53 | { 54 | CLI::write( 55 | lang('DB.lastInsertID') . ': ' . CLI::color($this->db->insertID(), 'green') 56 | ); 57 | } 58 | 59 | return; 60 | } 61 | 62 | $result = $result->getResultArray(); 63 | 64 | if (empty($result)) 65 | { 66 | CLI::write(lang('DB.noResults')); 67 | 68 | return; 69 | } 70 | 71 | CLI::table($result, array_keys($result[0])); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Commands/Show.php: -------------------------------------------------------------------------------- 1 | 'DB.databaseName', 20 | ]; 21 | 22 | public function run(array $params) 23 | { 24 | $database = array_shift($params); 25 | 26 | if (empty($database)) 27 | { 28 | $group = $this->getDatabaseGroup(); 29 | $default = config('Database')->{$group}['database'] ?? null; 30 | $database = CLI::prompt(lang('DB.databaseName'), $default, 'regex_match[\w.]'); 31 | CLI::newLine(); 32 | } 33 | 34 | $show = $this->db->query('SHOW DATABASES LIKE :database:', [ 35 | 'database' => $database, 36 | ])->getRowArray(); 37 | 38 | if (empty($show)) 39 | { 40 | CLI::beep(); 41 | CLI::error(lang('DB.databaseNotFound', [$database])); 42 | 43 | return; 44 | } 45 | 46 | // List Tables 47 | $list = $this->getTableList($database); 48 | 49 | if ($list) 50 | { 51 | CLI::write( 52 | CLI::color(lang('DB.database') . ': ', 'white') . CLI::color($database, 'yellow') 53 | ); 54 | CLI::table($list, array_keys($list[0])); 55 | CLI::write(lang('DB.total') . ': ' . count($list)); 56 | 57 | return; 58 | } 59 | 60 | CLI::write(lang('DB.databaseNoTables', [$database])); 61 | } 62 | 63 | public function getTableList(string $database): array 64 | { 65 | $sql = 'SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, DATA_LENGTH, INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT, TABLE_ROWS, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = :database: ORDER BY TABLE_NAME'; 66 | 67 | $tables = $this->db->query($sql, ['database' => $database]) 68 | ->getResultArray(); 69 | 70 | $list = []; 71 | 72 | helper('number'); 73 | 74 | foreach ($tables as $table) 75 | { 76 | $list[] = [ 77 | lang('DB.tableName') => $table['TABLE_NAME'], 78 | lang('DB.engine') => $table['ENGINE'], 79 | lang('DB.collation') => $table['TABLE_COLLATION'], 80 | lang('DB.dataLength') => number_to_size($table['DATA_LENGTH']), 81 | lang('DB.indexLength') => number_to_size($table['INDEX_LENGTH']), 82 | lang('DB.dataFree') => number_to_size($table['DATA_FREE']), 83 | lang('DB.autoIncrement') => $table['AUTO_INCREMENT'], 84 | lang('DB.rows') => $table['TABLE_ROWS'], 85 | lang('DB.comment') => $table['TABLE_COMMENT'], 86 | ]; 87 | } 88 | 89 | return $list; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/Commands/ShowTable.php: -------------------------------------------------------------------------------- 1 | 'DB.tableName', 20 | ]; 21 | 22 | public function run(array $params) 23 | { 24 | $table = array_shift($params); 25 | 26 | if (empty($table)) 27 | { 28 | $table = CLI::prompt(lang('DB.tableName'), null, 'regex_match[\w.]'); 29 | CLI::newLine(); 30 | } 31 | 32 | if (strpos($table, '.') !== false) 33 | { 34 | [$database, $table] = explode('.', $table, 2); 35 | 36 | $this->db->setDatabase($database); 37 | } 38 | 39 | $show = $this->db->query('SHOW TABLES LIKE :table:', [ 40 | 'table' => $table, 41 | ])->getRowArray(); 42 | 43 | if (empty($show)) 44 | { 45 | CLI::beep(); 46 | CLI::error(lang('DB.tableNotExists', [$table])); 47 | 48 | return; 49 | } 50 | 51 | // FIELDS 52 | $fields = $this->getFields($table); 53 | CLI::write( 54 | CLI::color(lang('DB.table') . ': ', 'white') 55 | . CLI::color($table, 'yellow') 56 | ); 57 | CLI::table($fields, array_keys($fields[0])); 58 | CLI::newLine(); 59 | 60 | // INDEXES 61 | $indexes = $this->getIndexes($table); 62 | 63 | if ($indexes) 64 | { 65 | CLI::write(lang('DB.indexes'), 'white'); 66 | CLI::table($indexes, array_keys($indexes[0])); 67 | CLI::newLine(); 68 | } 69 | 70 | // FOREIGN KEYS 71 | $foreign_keys = $this->getForeignKeys($table); 72 | 73 | if ($foreign_keys) 74 | { 75 | CLI::write(lang('DB.foreignKeys'), 'white'); 76 | CLI::table($foreign_keys, array_keys($foreign_keys[0])); 77 | CLI::newLine(); 78 | } 79 | } 80 | 81 | protected function getFields(string $table): array 82 | { 83 | $show = $this->db->query('SHOW FULL COLUMNS FROM ' . $this->db->escapeIdentifiers($table)) 84 | ->getResultArray(); 85 | 86 | if ($show) 87 | { 88 | $columns = []; 89 | 90 | foreach ($show as $row) 91 | { 92 | preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row['Type'], 93 | $match); 94 | 95 | $columns[] = [ 96 | 'field' => $row['Field'], 97 | 'full_type' => $row['Type'], 98 | 'type' => $match[1] ?? null, 99 | 'length' => $match[2] ?? null, 100 | 'unsigned' => ltrim(($match[3] ?? null) . ($match[4] ?? null)), 101 | 'default' => ($row['Default'] !== '' || preg_match('~char|set~', 102 | $match[1]) ? $row['Default'] : null), 103 | 'null' => ($row['Null'] === 'YES'), 104 | 'auto_increment' => ($row['Extra'] === 'auto_increment'), 105 | 'on_update' => (preg_match('~^on update (.+)~i', $row['Extra'], $match) 106 | ? $match[1] : ''), 107 | 'collation' => $row['Collation'], 108 | 'privileges' => array_flip(preg_split('~, *~', $row['Privileges'])), 109 | 'comment' => $row['Comment'], 110 | 'primary' => ($row['Key'] === 'PRI'), 111 | ]; 112 | } 113 | 114 | $cols = []; 115 | 116 | foreach ($columns as $col) 117 | { 118 | $cols[] = [ 119 | lang('DB.column') => $col['field'] . ($col['primary'] 120 | ? ' PRIMARY' : ''), 121 | lang('DB.type') => $col['full_type'] . ($col['collation'] 122 | ? ' ' . $col['collation'] : '') . ($col['auto_increment'] 123 | ? ' ' . lang('DB.autoIncrement') : ''), 124 | lang('DB.nullable') => $col['null'] ? lang('DB.yes') 125 | : lang('DB.no'), 126 | lang('DB.default') => $col['default'], 127 | lang('DB.comment') => $col['comment'], 128 | ]; 129 | } 130 | 131 | return $cols; 132 | } 133 | 134 | return []; 135 | } 136 | 137 | protected function getIndexes(string $table): array 138 | { 139 | $indexes = $this->db->getIndexData($table); 140 | $keys = []; 141 | 142 | if ($indexes) 143 | { 144 | $lang_name = lang('DB.name'); 145 | $lang_type = lang('DB.type'); 146 | $lang_columns = lang('DB.columns'); 147 | 148 | foreach ($indexes as $index) 149 | { 150 | $keys[] = [ 151 | $lang_name => $index->name, 152 | $lang_type => $index->type, 153 | $lang_columns => implode(', ', $index->fields), 154 | ]; 155 | } 156 | } 157 | 158 | return $keys; 159 | } 160 | 161 | protected function getForeignKeys(string $table): array 162 | { 163 | $show = $this->db->query('SHOW CREATE TABLE ' . $this->db->escapeIdentifiers($table)) 164 | ->getRowArray(); 165 | 166 | if ($show) 167 | { 168 | $create_table = $show['Create Table']; 169 | 170 | $on_actions = 'RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT'; 171 | 172 | $pattern = '`(?:[^`]|``)+`'; 173 | 174 | preg_match_all("~CONSTRAINT ($pattern) FOREIGN KEY ?\\(((?:$pattern,? ?)+)\\) REFERENCES ($pattern)(?:\\.($pattern))? \\(((?:$pattern,? ?)+)\\)(?: ON DELETE ($on_actions))?(?: ON UPDATE ($on_actions))?~", 175 | $create_table, $matches, PREG_SET_ORDER); 176 | 177 | $foreign_keys = []; 178 | 179 | foreach ($matches as $match) 180 | { 181 | preg_match_all("~$pattern~", $match[2], $source); 182 | preg_match_all("~$pattern~", $match[5], $target); 183 | $foreign_keys[] = [ 184 | 'index' => str_replace('`', '', $match[1]), 185 | 'source' => str_replace('`', '', $source[0][0]), 186 | 'database' => str_replace('`', '', $match[4] !== '' ? $match[3] : $match[4]), 187 | 'table' => str_replace('`', '', $match[4] !== '' ? $match[4] : $match[3]), 188 | 'field' => str_replace('`', '', $target[0][0]), 189 | 'on_delete' => (! empty($match[6]) ? $match[6] : 'RESTRICT'), 190 | 'on_update' => (! empty($match[7]) ? $match[7] : 'RESTRICT'), 191 | ]; 192 | } 193 | 194 | $fks = []; 195 | 196 | foreach ($foreign_keys as $fk) 197 | { 198 | $fks[] = [ 199 | lang('DB.source') => $fk['source'], 200 | lang('DB.target') => (! empty($fk['database']) 201 | ? $fk['database'] . '.' 202 | : '') 203 | . $fk['table'] . '(' . $fk['field'] . ')', 204 | 'ON DELETE' => $fk['on_delete'], 205 | 'ON UPDATE' => $fk['on_update'], 206 | ]; 207 | } 208 | 209 | return $fks; 210 | } 211 | 212 | return []; 213 | } 214 | } 215 | -------------------------------------------------------------------------------- /src/Language/en/DB.php: -------------------------------------------------------------------------------- 1 | 'Database', 5 | 'table' => 'Table', 6 | 'tables' => 'Tables', 7 | 'name' => 'Name', 8 | 'tableName' => 'Table Name', 9 | 'indexes' => 'Indexes', 10 | 'foreignKeys' => 'Foreign Keys', 11 | 'column' => 'Column', 12 | 'columns' => 'Columns', 13 | 'type' => 'Type', 14 | 'nullable' => 'Nullable', 15 | 'default' => 'Default', 16 | 'comment' => 'Comment', 17 | 'autoIncrement' => 'Auto Increment', 18 | 'engine' => 'Engine', 19 | 'collation' => 'Collation', 20 | 'rows' => 'Rows', 21 | 'size' => 'Size', 22 | 'dataFree' => 'Data Free', 23 | 'dataLength' => 'Data Length', 24 | 'indexLength' => 'Index Length', 25 | 'source' => 'Source', 26 | 'target' => 'Target', 27 | 'yes' => 'Yes', 28 | 'no' => 'No', 29 | 'tableNotExists' => 'Table "{0}" does not exists.', 30 | 'tableDeleted' => 'Table "{0}" successful deleted.', 31 | 'tableNotDeleted' => 'Table "{0}" could not be deleted.', 32 | 'createsDatabase' => 'Creates a database', 33 | 'deletesDatabase' => 'Deletes a database', 34 | 'deletesTable' => 'Deletes a database table', 35 | 'listsDatabases' => 'Lists databases', 36 | 'databaseName' => 'Database name', 37 | 'databaseExists' => 'Database "{0}" already exists.', 38 | 'databaseNotExists' => 'Database "{0}" does not exists.', 39 | 'databaseCreated' => 'Database "{0}" successful created.', 40 | 'databaseDeleted' => 'Database "{0}" successful deleted.', 41 | 'databaseNotCreated' => 'Database "{0}" could not be created.', 42 | 'databaseNotDeleted' => 'Database "{0}" could not be deleted.', 43 | 'showsDatabase' => 'Shows databases information', 44 | 'showsTable' => 'Shows a database table structure', 45 | 'queryToExecute' => 'The query to execute', 46 | 'databaseNoTables' => 'Database "{0}" has no tables.', 47 | 'databaseNotFound' => 'Database "{0}" was not found.', 48 | 'executesQuery' => 'Executes a SQL query', 49 | 'query' => 'Query', 50 | 'noResults' => 'No results.', 51 | 'noDatabases' => 'No databases.', 52 | 'affectedRows' => '{0, plural, =0{No affected row} =1{One affected row} other{# affected rows}}.', 53 | 'lastInsertID' => 'Last inserted ID', 54 | 'total' => 'Total', 55 | ]; 56 | -------------------------------------------------------------------------------- /src/Language/pt-BR/DB.php: -------------------------------------------------------------------------------- 1 | 'Banco de Dados', 5 | 'table' => 'Tabela', 6 | 'tables' => 'Tabelas', 7 | 'name' => 'Nome', 8 | 'tableName' => 'Nome da Tabela', 9 | 'indexes' => 'Índices', 10 | 'foreignKeys' => 'Chaves Estrangeiras', 11 | 'column' => 'Coluna', 12 | 'columns' => 'Colunas', 13 | 'type' => 'Tipo', 14 | 'nullable' => 'Nulável', 15 | 'default' => 'Padrão', 16 | 'comment' => 'Comentário', 17 | 'autoIncrement' => 'Incremento Automático', 18 | 'engine' => 'Motor', 19 | 'collation' => 'Colação', 20 | 'rows' => 'Linhas', 21 | 'size' => 'Tamanho', 22 | 'dataFree' => 'Dados Livres', 23 | 'dataLength' => 'Tamanho de Dados', 24 | 'indexLength' => 'Tamanho do Índice', 25 | 'source' => 'Origem', 26 | 'target' => 'Destino', 27 | 'yes' => 'Sim', 28 | 'no' => 'Não', 29 | 'tableNotExists' => 'Tabela "{0}" não existe.', 30 | 'tableDeleted' => 'Tabela "{0}" excluída com sucesso.', 31 | 'tableNotDeleted' => 'Tabela "{0}" não pode ser excluída.', 32 | 'createsDatabase' => 'Cria um banco de dados', 33 | 'deletesDatabase' => 'Exclui um banco de dados', 34 | 'deletesTable' => 'Exclui uma tabela do banco de dados', 35 | 'listsDatabases' => 'Lista bancos de dados', 36 | 'databaseName' => 'Nome do Banco de Dados', 37 | 'databaseExists' => 'Banco de dados "{0}" já existe.', 38 | 'databaseNotExists' => 'Banco de dados "{0}" não existe.', 39 | 'databaseCreated' => 'Banco de dados "{0}" criado com sucesso.', 40 | 'databaseDeleted' => 'Banco de dados "{0}" excluído com sucesso.', 41 | 'databaseNotCreated' => 'Banco de dados "{0}" não pode ser criado.', 42 | 'databaseNotDeleted' => 'Banco de dados "{0}" não pode ser excluído.', 43 | 'showsDatabase' => 'Mostra informações de bancos de dados', 44 | 'showsTable' => 'Mostra a estrutura de uma tabela de banco de dados', 45 | 'queryToExecute' => 'A consulta a executar', 46 | 'databaseNoTables' => 'Banco de dados "{0}" não possui tabelas.', 47 | 'databaseNotFound' => 'Banco de dados "{0}" não foi encontrado.', 48 | 'executesQuery' => 'Executa uma consulta SQL', 49 | 'query' => 'Consulta', 50 | 'noResults' => 'Nenhum resultado.', 51 | 'noDatabases' => 'Nenhum banco de dados.', 52 | 'affectedRows' => '{0, plural, =0{Nenhuma linha afetada} =1{Uma linha afetada} other{# linhas afetadas}}.', 53 | 'lastInsertID' => 'Último ID inserido', 54 | 'total' => 'Total', 55 | ]; 56 | --------------------------------------------------------------------------------