Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5123. Document SQL query results with pretty formatting #5124

Merged
merged 1 commit into from Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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