dimas-b commented on code in PR #1371: URL: https://github.com/apache/polaris/pull/1371#discussion_r2060969668
########## extension/persistence/relational-jdbc/src/main/java/org/apache/polaris/extension/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java: ########## @@ -106,12 +111,21 @@ private void initializeForRealm( } private DatasourceOperations getDatasourceOperations(boolean isBootstrap) { - DatasourceOperations databaseOperations = new DatasourceOperations(dataSource); + // TODO: remove when multiple dataSources are supported. + if (dataSources.size() > 1) { + throw new IllegalStateException("More than one dataSources configured"); + } + DatasourceOperations databaseOperations = new DatasourceOperations(dataSources.getFirst()); if (isBootstrap) { - // TODO: see if we need to take script from Quarkus or can we just - // use the script committed in the repo. try { - databaseOperations.executeScript("scripts/postgres/schema-v1-postgres.sql"); + DatabaseType databaseType; + try (Connection connection = dataSources.getFirst().getConnection()) { + String productName = + connection.getMetaData().getDatabaseProductName().toLowerCase(Locale.ROOT); + databaseType = DatabaseType.fromDisplayName(productName); + } + databaseOperations.executeScript( + String.format("%s/schema-v1.sql", databaseType.getDisplayName())); Review Comment: Now that `DatabaseType.getInitScriptResource()` is available, should we use it here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org