Skip to content

Commit

Permalink
Advertise use prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 28, 2024
1 parent 384cbf7 commit f6a8c81
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,26 @@ class Query extends Command {
private $connection, $query;
private $verbose= false;

/**
* Connection DSN, e.g. `mysql://user:pass@host[:port][/database]`
*
* @param string $dsn
*/
/** Connection DSN, e.g. `mysql://user:pass@host[:port][/database]` */
#[Arg(position: 0)]
public function setConnection($dsn) {
public function useConnection(string $dsn) {
$this->connection= DriverManager::getConnection($dsn);
$this->connection->connect();
}

/**
* SQL query. Use `-` to read from standard input.
*
* @param string $query
*/
/** SQL query. Use `-` to read from standard input */
#[Arg(position: 1)]
public function setQuery($query) {
public function useQuery(string $query) {
if ('-' === $query) {
$this->query= Streams::readAll($this->in->stream());
} else {
$this->query= $query;
}
}

/**
* Verbose output
*/
/** Verbose output */
#[Arg]
public function setVerbose() {
public function useVerbose() {
$this->verbose= true;
}

Expand Down

0 comments on commit f6a8c81

Please sign in to comment.