Skip to content

Commit bd668b9

Browse files
committed
chore: dings
1 parent d974082 commit bd668b9

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

driver/api/src/main/java/eu/cloudnetservice/driver/database/Database.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ public interface Database extends Named, AutoCloseable {
306306
@NonNull
307307
CompletableFuture<Void> clearAsync();
308308

309-
/**
310309
/**
311310
* Get the amount of key-value pairs currently stored in the database.
312311
* <p>

modules/database-sql/impl/src/main/java/eu/cloudnetservice/modules/sql/impl/JooqProvider.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ public boolean synced() {
8888

8989
@Override
9090
public @NonNull LocalDatabase database(@NonNull String name) {
91-
this.tableCreator.createTable(
92-
this.dslContext,
93-
name,
94-
JooqDatabase.KEY_FIELD,
95-
JooqDatabase.DOCUMENT_FIELD);
96-
return new JooqDatabase(name, this, this.dslContext);
91+
return this.databaseCache.get(name, _ -> {
92+
this.tableCreator.createTable(
93+
this.dslContext,
94+
name,
95+
JooqDatabase.KEY_FIELD,
96+
JooqDatabase.DOCUMENT_FIELD);
97+
return new JooqDatabase(name, this, this.dslContext);
98+
});
9799
}
98100

99101
@Override

modules/database-sql/impl/src/main/java/eu/cloudnetservice/modules/sql/impl/table/PostgreSQLTableCreator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,5 @@ public void createTable(
3737
.column(documentField, SQLDataType.JSONB.notNull())
3838
.primaryKey(keyField)
3939
.execute();
40-
41-
dslContext.execute("CREATE INDEX IF NOT EXISTS ")
4240
}
4341
}

0 commit comments

Comments
 (0)