Use static code analysis to ensure database portability
@DerDreschner is already working on this.
Since Jul 14, 2026.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
[!TIP]
Help move this idea forward
- Use the 👍 reaction to show support for this feature.
- Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
- Subscribe to receive notifications about status changes and new comments.
Is your feature request related to a problem? Please describe.
When developing for Nextcloud, there are several limitations for database queries to ensure portability against several database backends. Keeping all those limitations in mind is pretty challaging and even our own full-time developers fail to do so sometimes. Since those limitations raise on runtime only, we should think about ways to ensure portability before merging any code.
Describe the solution you'd like
I like some kind of rector rule-set to check against all code and check for violations. A good starting point for "what limitations to check for" are the comments in the several exceptions we have there: https://github.com/nextcloud/server/tree/3d9c47f5788b5138773122c02b94140faba334b5/lib/private/DB/QueryBuilder
Describe alternatives you've considered
I've checked if there are any rule-sets we could simply apply (like officially supported by doctrine). But I didn't found one.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.