@Override public CheckResult check() { try (Connection conn = datasource.getConnection()) { if (!context.get(conn).meta().getSchemas().contains(DEFAULT_CATALOG.ZIPKIN)) { throw new IllegalStateException("Zipkin schema is missing"); } } catch (SQLException | RuntimeException e) { return CheckResult.failed(e); } return CheckResult.OK; }
private List<Schema> getSchemasFromMeta() { if (schemas == null) { schemas = new ArrayList<Schema>(); for (Schema schema : create().meta().getSchemas()) if (getInputSchemata().contains(schema.getName())) schemas.add(schema); } return schemas; }
public void checkOrCreate( DSLContext dsl, Meta jooqMeta, DatabaseMetaData jdbcMeta, DatabaseInterface databaseInterface ) throws SQLException, InvalidDatabaseException { Schema torodbSchema = null; for (Schema schema : jooqMeta.getSchemas()) { if (TORODB_SCHEMA.equals(schema.getName())) { torodbSchema = schema; break; } } if (torodbSchema == null) { LOGGER.info("Schema '{}' not found. Creating it...", TORODB_SCHEMA); createSchema(dsl, databaseInterface); LOGGER.info("Schema '{}' created", TORODB_SCHEMA); } else { LOGGER.info("Schema '{}' found. Checking it...", TORODB_SCHEMA); checkSchema(torodbSchema, databaseInterface); LOGGER.info("Schema '{}' checked", TORODB_SCHEMA); } }
if (jooqMeta != null) { Schema standardSchema = null; for (Schema schema : jooqMeta.getSchemas()) { if (schema.getName().equals(schemaName)) { standardSchema = schema;
&& dsl.meta().getSchemas().stream().noneMatch( s -> schema.getName().equalsIgnoreCase( s.getName() ) ) )