Commit graph

291 commits

Author SHA1 Message Date
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
Joas Schilling
df36ed4d1a
Log missing primary key until we make it a requirement
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-08 10:47:24 +02:00
Joas Schilling
10b2319aa0
Add missing doc changes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 15:50:33 +02:00
Joas Schilling
82c33be744
Fix typos and empty tabs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 12:42:52 +02:00
John Molakvoæ
0257315c34
Improve error logging on migration failure
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:49:20 +02:00
John Molakvoæ
e20d5fa7fc
Ensure schema change before checking OracleConstraints
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:18:14 +02:00
Robin Appelman
1537c3d23b
record backtrace when profiling db requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 18:12:30 +02:00
Carl Schwan
135bdb3d58
Merge pull request #30823 from nextcloud/work/profiler
Built-in profiler

This adds the required API for collecting information about requests. This information
can then be displayed with the new 'profiler' app.
2022-04-04 12:56:37 +02:00
Carl Schwan
7d272c54d0 Add a built-in profiler inside Nextcloud
The webui is provided by a seperate application named profiler

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-04-04 10:28:26 +02:00
Côme Chilliet
dd357d7f9b
Merge pull request #31679 from nextcloud/bugfix/noid/ensure-string-columns-to-be-maximum-of-4000
Ensure string column limit of 4.000 characters
2022-03-31 11:37:43 +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
Joas Schilling
129bae62d4
Ensure string column limit of 4.000 characters
https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/datatype-limits.html#GUID-963C79C9-9303-49FE-8F2D-C8AAF04D3095

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-25 12:44:51 +01: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
ea23523c70
Adapt more code to migration to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +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
0acd4b5f82
Merge pull request #31235 from nextcloud/techdebt/noid/extract-request-id
Extract request id handling to dedicated class so it can be injected without DB dependency
2022-03-22 12:08:45 +01:00
Joas Schilling
3bed983a9c
Disable for now again until more apps are fixed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-21 12:14:19 +01:00
Joas Schilling
32ede5489e
Limit missing primary key fail to new tables
This will work on CI so devs notice it when they install the app for testing,
and at the same time existing faulty tables don't break the upgrade to 24

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-21 12:14:19 +01:00
Joas Schilling
b35253a4c3
Enforce primary keys as they are required to be performant in MySQL clusters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-10 10:24:05 +01:00
Julius Härtl
83717a7800
Add event logging for db and redis connection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-02-28 11:24:41 +01:00
Louis Chemineau
405c5eb813 Add --dry-run option for db:add-missing-* cmd
Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-02-24 16:42:08 +01:00
Joas Schilling
1c138d3ae2
Allow to prefix the Query log with the request id
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-23 11:01:58 +01:00
Joas Schilling
76541170bb
Allow specify a config prefix for another database connection
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-02-03 17:16:03 +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
John Molakvoæ
eb3cf6c5ec
Merge pull request #30129 from nextcloud/mdb10.6-pipeline 2022-01-19 09:25:46 +01:00
Carl Schwan
89d109a4d9
Merge pull request #30508 from nextcloud/fix/psaml-bin
Fix psalm not running
2022-01-13 09:51:04 +01:00
Carl Schwan
6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +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
Julius Härtl
a169ca306e
Explicitly cast char in the query builder
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2022-01-04 16:53:00 +01:00
Joas Schilling
005e717fe6
Use quote function
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 13:59:54 +01:00
Joas Schilling
ecc92067bf
Try escaping Oracle single quotes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 13:36:55 +01:00
Joas Schilling
46ad6fa3c7
Add a test with integer
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-04 09:15:17 +01:00
Joas Schilling
e3e73a12ef
Fix oracle LISTAGG
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-01-03 21:43:53 -03:00
Vitor Mattos
fb6a9f308d
Add unit test
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-03 21:41:38 -03:00
Vitor Mattos
7b9fea85b6
Add unit test and orderBy parameter
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-03 12:45:00 -03:00
Vitor Mattos
79b3df00f8
Add group_concat aggregator function
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-01-03 07:48:11 -03:00
Carl Schwan
52760a95d9
Check if directoy is writable instead of possibly missing file
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2021-12-20 15:36:52 +01:00
acsfer
06b77fd666
Attempt to fix CI 2021-12-07 11:58:30 +01:00