Skip to content

Don't deprecate IDBConnection::getDatabasePlatform #51175

Closed as not planned
Closed as not planned

Description

@pulsejet

Getting the underlying doctrine platform is useful for some low-level debugging. Is there any strong reason to deprecate this method?

I'm using it a lot for debugging queries, can't see any obvious clean alternative (correct me)

https://github.com/pulsejet/memories/blob/7c9ed8adba2ffaf99362db8fe5ffecc6d88a8088/lib/Db/SQL.php#L26-L45

Also needed for cross platform truncate.

https://github.com/pulsejet/memories/blob/7c9ed8adba2ffaf99362db8fe5ffecc6d88a8088/lib/Db/TimelineWrite.php#L256-L262

Activity

  1. pulsejet commented on Mar 1, 2025

    @pulsejet
    MemberAuthor
  2. susnux commented on Mar 1, 2025

    @susnux
    Contributor

    IIRC its needed for Doctrine DBAL 4.0 support, ref: #46192

    cc @nickvergessen

  3. nickvergessen commented on Mar 1, 2025

    @nickvergessen
    Member

    Yeah we can not keep them and we should not expose them.

    I'm using it a lot for debugging queries, can't see any obvious clean alternative

    Upstreaming? It sounds roughly like https://github.com/nextcloud/server/blob/master/lib/private/DB/QueryBuilder/QueryBuilder.php#L160-L188 But I also sometimes miss getting an "executable query" back or logged.

    Also needed for cross platform truncate.

    Alternative: Upstream 😎

    There are also edge cases where mysql and maria have different behavior

    I'm fine with adding a parameter to getDatabaseProvider() or a second method, which returns different for MySQL and MariaDB. We can't change the default as that would break quite some other places. But we must make sure that only OCP constants are returned, so it doesn't break when updating doctrine.

    Side note: But the actual problem is that you use polygon database type which is not supported by all databases we support. Ref doctrine/dbal#2334

  4. pulsejet commented on Mar 2, 2025

    @pulsejet
    MemberAuthor

    Noted, I'll make a migration plan then. Thanks for the prompt response!

    I'm fine with adding a parameter to getDatabaseProvider() or a second method, which returns different for MySQL and MariaDB.

    This will likely be needed first, I'll cook up something if possible.

    Thanks!

  5. pulsejet commented on Mar 2, 2025

    @pulsejet
    MemberAuthor

    But the actual problem is that you use polygon database type which is not supported by all databases we support

    Correct. It's not possible to do a real 2D lookup without some geometric type. Right now mysql / mariadb / postgres work fine (sqlite might work with some work, but doesn't seem worth the effort)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbugfeature: databaseDatabase related DBwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions