Commit Graph

312 Commits (9c4e892a91ce1320f6941987e7d65eaaa34896ca)

Author SHA1 Message Date
Arthur Schiwon 997c2a2a79
fix DBAL exception handling in setValues
This seems to be a left over after abstracting DBAL. Nowadays,
IQueryBuilder::executeStatement() only throws a \OCP\DB\Exception, where
previously original DBAL exceptions where thrown. These are now wrapped,
the orignal classes are now mapped to a reason.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2023-03-31 17:01:17 +07:00
Ferdinand Thiessen a9af58fd1a fix(DB): Remove not supported column comments when using SQLite
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
2023-02-22 01:07:26 +07:00
Robin Appelman 426b3429f7
log start time of queries for profiler
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-14 15:16:15 +07:00
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 +07: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 +07: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 +07:00
Côme Chilliet 8a16e7e8a1
Fix more psalm issues in OC\DB
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-21 11:30:20 +07:00
Côme Chilliet 378630f8a0
Fix psalm issues following doctrine/dbal bump
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-21 10:56:15 +07:00
Roeland Jago Douma d151999fc8
typehint migrationservice closures
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2022-10-09 21:31:27 +07:00
Retidurc Silvernight 2269f35842
Change option name again to be more like the other options
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
2022-09-23 09:48:02 +07:00
Retidurc Silvernight 0de8729d7b
Change config option to db.persistent
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
2022-09-23 09:48:01 +07:00
Retidurc Silvernight 90f3379dfc
Expose Doctrine settings in Netxcloud settings
Signed-off-by: Retidurc Silvernight <retidurc@silvernight.social>
2022-09-23 09:47:56 +07:00
Côme Chilliet 4ac81733bd
Declare strict types in all new Event classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-25 16:15:49 +07:00
Côme Chilliet a2a7150d6d
Migrate Repair events to OCP\EventDispatcher\Event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-25 16:15:48 +07:00
Côme Chilliet a83a8f0dde
Migrate Migrator::executeSql to OCP\EventDispatcher\Event
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-25 16:13:47 +07:00
Côme Chilliet 4ba30d40cf
Switch to string keys for argument of GenericEvent for OC\DB\Migrator
It seems checkTable is actually never dispatched?

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-25 16:13:46 +07: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 +07: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 +07: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 +07:00
Côme Chilliet c598e3cafa
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-21 16:36:25 +07:00
Côme Chilliet 1bd5222224
Fix PHP 8.2 warnings about undeclared properties
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-21 16:17:52 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00
Joas Schilling 10b2319aa0
Add missing doc changes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 15:50:33 +07:00
Joas Schilling 82c33be744
Fix typos and empty tabs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 12:42:52 +07:00
John Molakvoæ 0257315c34
Improve error logging on migration failure
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:49:20 +07:00
John Molakvoæ e20d5fa7fc
Ensure schema change before checking OracleConstraints
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:18:14 +07:00
Robin Appelman 1537c3d23b
record backtrace when profiling db requests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 18:12:30 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07: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 +07:00