{"record":{"id":"dd9fd6d63ae24b89","repo":"quarkusio/quarkus","slug":"could-not-guess-the-dialect-from-the-database-kind","errorCode":null,"errorMessage":"Could not guess the dialect from the database kind '${dbKind}'. Add an explicit 'quarkus.hibernate-orm.\"<persistence-unit-name>\".dialect' property.","messagePattern":"Could not guess the dialect from the database kind '(.+?)'\\. Add an explicit 'quarkus\\.hibernate-orm\\.\"<persistence-unit-name>\"\\.dialect' property\\.","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/util/HibernateProcessorSupport.java","lineNumber":94,"sourceCode":"        if (dbKind.isPresent() || explicitDialect.isPresent()) {\n            for (DatabaseKindDialectBuildItem item : dbKindDialectBuildItems) {\n                if (dbKind.isPresent() && DatabaseKind.is(dbKind.get(), item.getDbKind())\n                        || explicitDialect.isPresent() && item.getMatchingDialects().contains(explicitDialect.get())) {\n                    if (dbKind.isEmpty()) {\n                        dbKind = Optional.ofNullable(item.getDbKind());\n                    }\n                    dbProductName = item.getDatabaseProductName();\n                    if (dbProductName.isEmpty() && explicitDialect.isEmpty()) {\n                        dialect = item.getDialectOptional();\n                    }\n                    if (dbVersion.isEmpty()) {\n                        dbProductVersion = item.getDefaultDatabaseProductVersion();\n                    }\n                    break;\n                }\n            }\n            if (dialect.isEmpty() && dbProductName.isEmpty()) {\n                throw new ConfigurationException(\n                        \"Could not guess the dialect from the database kind '\"\n                                + dbKind.get()\n                                + \"'. Add an explicit '\"\n                                + HibernateOrmRuntimeConfig.puPropertyKey(persistenceUnitName, \"dialect\")\n                                + \"' property.\");\n            }\n        }\n\n        if (dialect.isPresent()) {\n            puPropertiesCollector.accept(AvailableSettings.DIALECT, dialect.get());\n        } else if (dbProductName.isPresent()) {\n            puPropertiesCollector.accept(AvailableSettings.JAKARTA_HBM2DDL_DB_NAME, dbProductName.get());\n        }\n\n        if (dbProductVersion.isPresent()) {\n            puPropertiesCollector.accept(AvailableSettings.JAKARTA_HBM2DDL_DB_VERSION, dbProductVersion.get());\n        }\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/util/HibernateProcessorSupport.java#L76-L112","documentation":"Quarkus tries to infer the Hibernate dialect from the configured datasource's db-kind and product name/version. When the database kind is unknown or provides no product name, the dialect cannot be guessed and ConfigurationException is thrown, asking for an explicit dialect property.","triggerScenarios":"setDialectAndStorageEngine resolves the db kind but ends with an empty dialect and empty dbProductName (e.g. dbKind present but no dialect mapping and no database product info from the datasource build item).","commonSituations":"Using a custom/uncommon db-kind; datasource configured with db-kind that has no built-in dialect mapping; Quarkus version where the DB kind mapping is missing; overriding product name detection fails for a proxy or wrapper driver.","solutions":["Set an explicit dialect: quarkus.hibernate-orm.\"<pu>\".dialect=org.hibernate.dialect.PostgreSQLDialect (or appropriate)","Verify quarkus.datasource.db-kind is a supported value (postgresql, mysql, mariadb, mssql, db2, oracle, h2, etc.)","If using a custom Dialect, ensure it is on the classpath and the fully-qualified class name is correct"],"exampleFix":"// before\nquarkus.datasource.db-kind=other\n// after\nquarkus.datasource.db-kind=postgresql\n# or, if the kind must stay custom:\nquarkus.hibernate-orm.dialect=org.hibernate.dialect.PostgreSQLDialect","handlingStrategy":"validation","validationCode":"// Confirm db-kind maps to a known dialect before relying on auto-detection\nSet<String> supported = Set.of(\"postgresql\",\"mysql\",\"mariadb\",\"mssql\",\"db2\",\"oracle\",\"h2\",\"derby\");\nif (!supported.contains(dbKind))\n    throw new IllegalStateException(\"Set quarkus.hibernate-orm.dialect explicitly for \" + dbKind);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a standard, supported db-kind value","Set the dialect explicitly when db-kind is custom or unusual","Pin Quarkus versions where your DB's dialect mapping is known to exist"],"tags":["quarkus","hibernate-orm","dialect","database"],"backgroundTag":"missing-dialect-configuration","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}