@@ -125,6 +125,8 @@ public function drop($options = ['extra' => self::REQ]): void
125
125
126
126
/**
127
127
* Open a SQL command-line interface using Drupal's credentials.
128
+ *
129
+ * To import an SQL dump, it is more efficient to use sql:connect than sql:cli. See Examples below.
128
130
*/
129
131
#[CLI \Command(name: self ::CLI , aliases: ['sqlc ' , 'sql-cli ' ])]
130
132
#[CLI \Option(name: 'extra ' , description: 'Add custom options to the connect string (e.g. --extra=--skip-column-names) ' )]
@@ -133,12 +135,14 @@ public function drop($options = ['extra' => self::REQ]): void
133
135
#[CLI \Topics(topics: [DocsCommands::POLICY ])]
134
136
#[CLI \Usage(name: 'drush sql:cli ' , description: 'Open a SQL command-line interface using Drupal \'s credentials. ' )]
135
137
#[CLI \Usage(name: 'drush sql:cli --extra=--progress-reports ' , description: 'Open a SQL CLI and skip reading table information. ' )]
136
- #[CLI \Usage(name: 'drush sql:cli < example.sql ' , description: 'Import sql statements from a file into the current database. ' )]
138
+ #[CLI \Usage(name: '$(drush sql:connect) < example.sql ' , description: 'Bash: Import SQL statements from a file into the current database. ' )]
139
+ #[CLI \Usage(name: 'eval (drush sql:connect) < example.sql ' , description: 'Fish: Import SQL statements from a file into the current database. ' )]
137
140
public function cli (InputInterface $ input , $ options = ['extra ' => self ::REQ ]): void
138
141
{
139
142
$ sql = SqlBase::create ($ options );
140
143
$ process = $ this ->processManager ()->shell ($ sql ->connect (), null , $ sql ->getEnv ());
141
144
if (!Tty::isTtySupported ()) {
145
+ $ this ->logger ()->warning ('It is slow to pass large amounts of data via stdin to the sql:cli command. See the Examples at https://www.drush.org/latest/commands/sql_cli/ for an alternative using sql:connect. ' );
142
146
$ process ->setInput ($ this ->stdin ()->getStream ());
143
147
} else {
144
148
$ process ->setTty ((bool ) $ this ->getConfig ()->get ('ssh.tty ' , $ input ->isInteractive ()));
0 commit comments