Skip to content

Commit

Permalink
Fix #5123. Document query reults with pretty formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Apr 14, 2022
1 parent cd91051 commit 48cfd4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Commands/sql/SqlCommands.php
Expand Up @@ -168,12 +168,14 @@ public function cli(InputInterface $input, $options = ['extra' => self::REQ]): v
* Browse user record. Table prefixes, if used, must be added to table names by hand.
* @usage drush sql:query --db-prefix "SELECT * FROM {users}"
* Browse user record. Table prefixes are honored. Caution: All curly-braces will be stripped.
* @usage $(drush sql-connect) < example.sql
* @usage $(drush sql:connect) < example.sql
* Import sql statements from a file into the current database.
* @usage drush sql:query --file=example.sql
* Alternate way to import sql statements from a file.
* @usage drush ev "return db_query('SELECT * FROM users')->fetchAll()" --format=json
* Get data back in JSON format. See https://github.com/drush-ops/drush/issues/3071#issuecomment-347929777.
* @usage `drush sql:connect` -e "select * from users limit 5;"
* Results are formatted in a pretty table with borders and column headers.
* @bootstrap max configuration
*
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Sql/SqlBase.php
Expand Up @@ -632,8 +632,8 @@ public function alwaysQueryCommand($input_file): array
return [
$this->command(),
$this->creds(!$this->getOption('show-passwords')),
$this->silent(),
// This removes column header and various helpful things in mysql.
$this->silent(),
$this->getOption('extra', $this->queryExtra),
$this->queryFile,
Escape::shellArg($input_file),
Expand Down

0 comments on commit 48cfd4d

Please sign in to comment.