ci: Bump aura/sqlquery version.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2023-05-15 09:43:22 +02:00
parent ab6061bf34
commit 651a1271f1
8 changed files with 343 additions and 287 deletions

View File

@@ -55,7 +55,7 @@
"symfony/console": "^v5.1",
"symfony/lock": "^v5.0",
"ocramius/proxy-manager": "~2.0",
"aura/sqlquery": "~2.8"
"aura/sqlquery": "~3.0"
},
"require-dev": {
"roave/security-advisories": "dev-latest",

571
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -175,7 +175,7 @@ final class AccountFileRepository extends Repository implements AccountFileRepos
$query = $this->queryFactory
->newDelete()
->from('AccountFile')
->where(sprintf('AccountFile.id IN (%s)', $this->buildParamsFromArray($ids)), ...$ids);
->where('AccountFile.id IN (:accountFileIds)', ['accountFileIds' => $ids]);
$queryData = QueryData::build($query)->setOnErrorMessage(__u('Error while deleting the files'));
@@ -213,9 +213,9 @@ final class AccountFileRepository extends Repository implements AccountFileRepos
if (!empty($itemSearchData->getSeachString())) {
$query->where('AccountFile.name LIKE :name')
->orWhere('AccountFile.type LIKE :type')
->orWhere('Account.name LIKE :accountName')
->orWhere('Client.name LIKE :clientName');
->orWhere('AccountFile.type LIKE :type')
->orWhere('Account.name LIKE :accountName')
->orWhere('Client.name LIKE :clientName');
$search = '%'.$itemSearchData->getSeachString().'%';

View File

@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -279,7 +279,7 @@ final class AccountHistoryRepository extends Repository implements AccountHistor
$query = $this->queryFactory
->newDelete()
->from('AccountHistory')
->where(sprintf('id IN (%s)', $this->buildParamsFromArray($ids)), ...$ids);
->where('id IN (:ids)', ['ids' => $ids]);
$queryData = QueryData::build($query)->setOnErrorMessage(__u('Error while deleting the accounts'));
@@ -304,7 +304,7 @@ final class AccountHistoryRepository extends Repository implements AccountHistor
$query = $this->queryFactory
->newDelete()
->from('AccountHistory')
->where(sprintf('accountId IN (%s)', $this->buildParamsFromArray($ids)), ...$ids);
->where('accountId IN (:accountIds)', ['accountIds' => $ids]);
$queryData = QueryData::build($query)->setOnErrorMessage(__u('Error while deleting the accounts'));

View File

@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -475,7 +475,7 @@ final class AccountRepository extends Repository implements AccountRepositoryInt
$query = $this->queryFactory
->newDelete()
->from('Account')
->where(sprintf('id IN (%s)', $this->buildParamsFromArray($accountsId)), ...$accountsId);
->where('id IN (:ids)', ['ids' => $accountsId]);
$queryData = QueryData::build($query)->setOnErrorMessage(__u('Error while deleting the accounts'));

View File

@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -119,7 +119,7 @@ final class PublicLinkRepository extends Repository implements \SP\Domain\Accoun
$query = $this->queryFactory
->newDelete()
->from('PublicLink')
->where(sprintf('id IN (%s)', $this->buildParamsFromArray($ids)), ...$ids);
->where('id IN (:ids)', ['ids' => $ids]);
return $this->db->doQuery(QueryData::build($query))->getAffectedNumRows();
}
@@ -165,8 +165,8 @@ final class PublicLinkRepository extends Repository implements \SP\Domain\Accoun
if (!empty($itemSearchData->getSeachString())) {
$query->where('User.login LIKE :login')
->orWhere('Account.name LIKE :accountName')
->orWhere('Client.name LIKE :clientName');
->orWhere('Account.name LIKE :accountName')
->orWhere('Client.name LIKE :clientName');
$search = '%'.$itemSearchData->getSeachString().'%';

View File

@@ -4,7 +4,7 @@
*
* @author nuxsmin
* @link https://syspass.org
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
* @copyright 2012-2023, Rubén Domínguez nuxsmin@$syspass.org
*
* This file is part of sysPass.
*
@@ -24,29 +24,14 @@
namespace SP\Infrastructure\Common\Repositories;
use Aura\SqlQuery\Common\Quoter;
use Aura\SqlQuery\QueryInterface;
use Aura\SqlQuery\Quoter;
/**
* Class Query
*/
final class Query implements QueryInterface
{
/**
*
* The quote prefix/suffix to use for each type.
*
* @var array
*
*/
private const QUOTES = [
'Common' => ['"', '"'],
'Mysql' => ['`', '`'],
'Pgsql' => ['"', '"'],
'Sqlite' => ['"', '"'],
'Sqlsrv' => ['[', ']'],
];
private string $query;
private array $values;
private Quoter $quoter;
@@ -55,7 +40,7 @@ final class Query implements QueryInterface
{
$this->query = $query;
$this->values = $values;
$this->quoter = new Quoter(self::QUOTES[$db][0], self::QUOTES[$db][1]);
$this->quoter = new Quoter();
}
/**
@@ -64,7 +49,7 @@ final class Query implements QueryInterface
* @param string $query
* @param array $values
*
* @return \SP\Domain\Common\In\Query
* @return \SP\Infrastructure\Common\Repositories\Query
*/
public static function buildForMySQL(string $query, array $values): Query
{
@@ -156,4 +141,9 @@ final class Query implements QueryInterface
{
return $this->query;
}
public function resetFlags()
{
// TODO: Implement resetFlags() method.
}
}

View File

@@ -85,7 +85,6 @@ final class QueryData
{
if ($this->query instanceof Select) {
$countQuery = (clone $this->query)
->resetFlags()
->resetCols()
->resetOrderBy()
->resetGroupBy()