Commit graph

152 commits

Author SHA1 Message Date
Joas Schilling
0b2357f7f8
Test oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:41:15 +02:00
Joas Schilling
5fdc5d5011
fix(db)!: Too few arguments to function Doctrine\DBAL\Query\Expression\ExpressionBuilder::or(), 0 passed and atleast 1 expected
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:53 +02:00
Joas Schilling
f0348be4c8
fix(db): Replace more Platform usages
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:50 +02:00
Joas Schilling
4c80fdd2bd
fix(db): Adjust unit tests of query builder
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:49 +02:00
Joas Schilling
1370693133
fix(db): Remove usage of Platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:47 +02:00
Joas Schilling
6b2f1367cd
fix(db): Map parameter types to doctrine's enums
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:46 +02:00
Joas Schilling
98b6c7c48a
fix(db): Add a hint that we return PHP_INT_MAX
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:46 +02:00
Joas Schilling
715656927c
fix(db): Argument 2 of \Doctrine\DBAL\Platforms\AbstractPlatform::getBitAndComparisonExpression expects string
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:45 +02:00
Joas Schilling
926f2ab887
fix(db): Too many arguments for method \Doctrine\DBAL\Connection::quote() - saw 2
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:44 +02:00
Joas Schilling
4bbaae5798
fix(db): ExpressionBuilder::like expects string, but OCP\DB\QueryBuilder\IQueryFunction provided
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:41 +02:00
Joas Schilling
6e90ddf41a
fix(db): Doctrine\DBAL\Query\Expression\CompositeExpression::add* does not exist
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:40 +02:00
Joas Schilling
ec1a3d6cd3
fix(db): Doctrine\DBAL\Query\QueryBuilder::getState does not exist
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:39 +02:00
Joas Schilling
f6ac69a2a0
fix(db)!: Doctrine\DBAL\Platforms\PostgreSQL94Platform was removed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:36 +02:00
Joas Schilling
d9e69e14f3
fix(db)!: Table alias for DELETE and UPDATE no longer supported
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:36 +02:00
Joas Schilling
f45ac5bb68
fix(db): Doctrine\DBAL\Query\Expression\ExpressionBuilder::andX() and ::orX() were removed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:34 +02:00
Joas Schilling
648b20c588
fix(db)!: Manually track the query type and whether WHERE is empty
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:30 +02:00
Joas Schilling
de0141d83c
fix(db)!: Empty and adjust query-part related methods
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:29 +02:00
Joas Schilling
015a3e85fe
fix(db)!: Fix casing of doctrine's SQLitePlatform
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-04 14:19:28 +02:00
Andy Scherzinger
dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Joas Schilling
90ba7db0fb
fix(querybuilder): Remove temporary internal method executeUpdate()
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-04-30 15:13:12 +02:00
Côme Chilliet
26c4ca264f
fix: Remove bogus code from query builder and fix parameter name
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-30 09:23:58 +02:00
Côme Chilliet
ab6afe0111 fix: Fix new psalm errors from update
Not sure about the SimpleContainer modification, let’s see what CI says
 about that.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-08 11:29:09 +02:00
Julius Härtl
86dc766276 Cast datetime columns in sqlite before comparing
Move the logic to prepare a column to the parent ExpressionBuilder so
that it can be reused for OCI and sqlite

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-12-29 10:36:59 +01:00
Arthur Schiwon
93505b2cdd fix(workflowengine): use andWhere() not second where()
- an unconditional where() condition is added right before
- fixes also wrongly named methods in the Exception message

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-11-13 14:47:47 +01:00
Joas Schilling
15a7aa51c5
fix(dbal): Fix types in query builder methods for parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-18 07:09:08 +02:00
Faraz Samapoor
e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +03:30
Joas Schilling
ecad09b38a
Merge pull request #36261 from nextcloud/techdebt/noid/warn-devs-about-potential-bugs
fix(querybuilder): Log a warning if where() is called again on a quer…
2023-01-23 18:47:25 +01:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Joas Schilling
7f0a54c558
fix(querybuilder): Log a warning if where() is called again on a query builder object
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-01-20 07:41:19 +01:00
Robin Appelman
6e0123a1d0 Revert "add case statement to sql function builder"
This reverts commit 2a68819a67.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 12:07:13 +02:00
Robin Appelman
9b52663a81 Revert "make expression build return IQueryFunction instead of string"
This reverts commit 813b50ed42.

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 12:07:09 +02:00
luz paz
368f83095d Fix typos in lib/private subdirectory
Found via `codespell -q 3 -S l10n -L jus ./lib/private`

Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 -04:00
Robin Appelman
2a68819a67
add case statement to sql function builder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-02 15:52:12 +02:00
Robin Appelman
813b50ed42
make expression build return IQueryFunction instead of string
this allows passing the expressions to further expressions without them being escaped as column names

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-06-02 15:52:08 +02:00
Carl Schwan
9ec0cb0a90 Fix psalm issues related to the user backend
- Reflect the actual return value returned by the implementation in the
  the interface. E.g. IUser|bool -> IUser|false
- Remove $hasLoggedIn parameter from private countUser implementation.
  Replace the two call with the equivalent countSeenUser
- getBackend is nuallable, add this to the interface
- Use backend interface to make psalm happy about call to undefined
  methods. Also helps with getting rid at some point of the old
  implementActions

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-20 17:14:58 +02:00
Robin Appelman
a4e120c203
tell mysql to ignore the sort index for search queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 13:42:33 +02:00
Côme Chilliet
765999f454
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
Migrate from ILogger to LoggerInterface in lib/private
2022-03-29 09:39:38 +02:00
Côme Chilliet
7407a324d9
Fix LENGTH function name across databases
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-28 00:01:17 +02:00
Côme Chilliet
25af856ed2 Use OCTET_LENGTH which is more common than LENGTHB
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 20:35:02 +00:00
Côme Chilliet
efebbacca4 Add octetLength and charLength to function builder, and tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 20:35:02 +00:00
Côme Chilliet
f1febfe696
Fix log level for exception in QueryBuilder
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:28 +01:00
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Joas Schilling
fccb98c8b6
Merge pull request #30379 from nextcloud/feature/add-comments-reactions
Add comments reactions
2022-01-21 15:08:12 +01:00
Joas Schilling
d850dc0220
Remove order from groupConcat as it is not working everywhere
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-21 08:39:39 -03:00
Vitor Mattos
f071b4dfbb
Fix groupConcat and ordering on Oracle
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:39:39 -03:00
Vitor Mattos
afe5b6dd8a
Prevent query error when use subquery
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-21 08:37:06 -03:00
Joas Schilling
de9fe8fcc1
Merge pull request #30471 from nextcloud/enh/cast-char-mysql
Explicitly cast char in the query builder
2022-01-20 14:32:56 +01:00
Vitor Mattos
f732cf1b04
Unit tests
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-07 09:54:41 +01:00
Vitor Mattos
814924a787
Accept multipe args on concat
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-06 08:12:10 -03:00
Joas Schilling
eebed2c434
Fix psalm complaint
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 17:32:07 +01:00