src/Db/Database.php
public function createCommand($sql = null, $params = [], $connection = null) {
        /** @var CommandInterface $command */
        $config = ['sql' => $sql, 'params' => $params, 'connection' => $connection];
        $command = $this->createComponent(CommandInterface::class, $config);
        return $command;
    }
public function createCommand($sql = null, $params = [], $connection = null) {
        /** @var CommandInterface $command */
        $config = ['sql' => $sql, 'params' => $params, 'connection' => $connection];
        $command = $this->createComponent(CommandInterface::class, $config);
        return $command;
    }
Create command
@param string|null              $sql
@param array                    $params
@param ConnectionInterface|null $connection
@return CommandInterface