diff options
author | Anna Larch <anna@nextcloud.com> | 2023-09-14 14:59:06 +0200 |
---|---|---|
committer | Anna <anna@nextcloud.com> | 2023-09-19 11:56:44 +0200 |
commit | 56419d94f8a128b503a8cd6fe74befe908bb2361 (patch) | |
tree | 4b77648640bd8ac98352a690bd5076f109f50f43 /lib/public | |
parent | 8157d9789070e6d38710b1530aa4d903d74ca2ac (diff) | |
download | nextcloud-server-56419d94f8a128b503a8cd6fe74befe908bb2361.tar.gz nextcloud-server-56419d94f8a128b503a8cd6fe74befe908bb2361.zip |
enh(db): provide database providers via API
To avoid leaking internals (OC), wrap the getDatabasePlatform and provide the
associated constants
fixes https://github.com/nextcloud/server/issues/30877
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/IDBConnection.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php index fe0267facc5..a528bb1a57b 100644 --- a/lib/public/IDBConnection.php +++ b/lib/public/IDBConnection.php @@ -45,6 +45,18 @@ use OCP\DB\QueryBuilder\IQueryBuilder; * @since 6.0.0 */ interface IDBConnection { + /* @since 28.0.0 */ + public const PLATFORM_MYSQL = 'mysql'; + + /* @since 28.0.0 */ + public const PLATFORM_ORACLE = 'oracle'; + + /* @since 28.0.0 */ + public const PLATFORM_POSTGRES = 'postgres'; + + /* @since 28.0.0 */ + public const PLATFORM_SQLITE = 'sqlite'; + /** * Gets the QueryBuilder for the connection. * @@ -339,4 +351,12 @@ interface IDBConnection { * @since 13.0.0 */ public function migrateToSchema(Schema $toSchema): void; + + /** + * Returns the database provider name + * @link https://github.com/nextcloud/server/issues/30877 + * @since 28.0.0 + * @return IDBConnection::PLATFORM_* + */ + public function getDatabaseProvider(): string; } |