AsyncDBManager

  
Type🟢 Interface
Packageio.github.mrtesz.teszcore.api.db.manager
GitHubAsyncDBManager.java
ExtendsDBManager

Description

Parent interface of all async database managers


Methods

createOrAlter

CompletableFuture<Void> createOrAlter(@NotNull DBTable dbTable);

Create or alter a SQL table using a DBTable object

ParameterTypeAnnotationsDescription
dbTable<abbr title=io.github.mrtesz.teszcore.api.db.table.DBTable>DBTable</abbr>@NotNullTable that will be created or altered

Returns: CompletableFuture<Void> — completes on finish or exceptionally on error

Throws: IllegalArgumentException when the provided DBTable is no suitable type for the executing AsyncDBManager


executeSql

CompletableFuture<Integer> executeSql(@NotNull String sql, @NotNull String tableName, @Nullable String type);
CompletableFuture<Integer> executeSql(@NotNull String sql, @NotNull String tableName, @NotNull List<Object> sqlParams, @Nullable String type);

Execute a SQL query

ParameterTypeAnnotationsDescription
sqlString@NotNullQuery that should be executed
sqlParamsList<Object>@NotNull(optional) Values replacing the ?’s in the sql query with statement.setObject
tableNameString@NotNullThe name of the table the statement is executed in - for logging
typeString@NullableThe type of execute e.g.: insert

Returns: CompletableFuture<Integer> — completes with the number of affected rows or exceptionally on error


executeSelect

CompletableFuture<SelectionResults> executeSelect(@NotNull String sql, @NotNull List<Object> sqlParams, @NotNull String tableName);
CompletableFuture<SelectionResults> executeSelect(@NotNull String sql, @NotNull String tableName);

Execute a selection query

ParameterTypeAnnotationsDescription
sqlString@NotNullThe selection query to be executed
sqlParamsList<Object>@NotNull(optional) Values replacing the ?’s in the sql query with statement.setObject
tableNameString@NotNullThe name of the table the statement is executed in - for logging

Returns: CompletableFuture<SelectionResults> — completes with the query results represented as a <abbr title=io.github.mrtesz.teszcore.db.selection.SelectionResults>SelectionResults</abbr> Object or exceptionally on error


insertInto

CompletableFuture<Integer> insertInto(@NotNull String tableName, @NotNull Map<String, Object> values);

Insert into a table

ParameterTypeAnnotationsDescription
tableNameString@NotNullThe name of the table, inserting into
valuesMap<String, Object>@NotNullValues to insert

Returns: CompletableFuture<Integer> — completes with the number of affected rows or exceptionally on error


insertIgnore

CompletableFuture<Integer> insertIgnore(@NotNull String tableName, @NotNull Map<String, Object> values);

Insert into a table, ignoring duplicate key violations or other constraint issues

ParameterTypeAnnotationsDescription
tableNameString@NotNullThe name of the table inserted to
valuesMap<String, Object>@NotNullValues to insert

Returns: CompletableFuture<Integer> — completes with the number of affected rows or exceptionally on error


deleteFrom

CompletableFuture<Integer> deleteFrom(@NotNull String tableName, @Nullable String whereClause, @NotNull List<Object> whereParams);
CompletableFuture<Integer> deleteFrom(@NotNull String tableName, @Nullable String whereClause);

Delete values from a table

ParameterTypeAnnotationsDescription
tableNameString@NotNullThe name of the table inserted to
whereClauseString@NullableClause, narrowing the targeted columns
whereParamsList<Object>@NotNull(optional) Values replacing the ?’s in the whereClause

Returns: CompletableFuture<Integer> — completes with the number of affected rows or exceptionally on error


update

CompletableFuture<Integer> update(@NotNull String tableName, @NotNull Map<String, Object> values, @Nullable String whereClause, @NotNull List<Object> whereParams);
CompletableFuture<Integer> update(@NotNull String tableName, @NotNull Map<String, Object> values, @Nullable String whereClause);

Update values of a table

ParameterTypeAnnotationsDescription
tableNameString@NotNullThe name of the table inserted to
valuesMap<String, Object@NotNullValues to update
whereClauseString@NullableClause, narrowing the targeted columns
whereParamsList<Object>@NotNull(optional) Values replacing the ?’s in the whereClause

Returns: CompletableFuture<Integer> — completes with the number of affected rows or exceptionally on error


dropTable

CompletableFuture<Integer> dropTable(@NotNull String tableName);

Drop a table

ParameterTypeAnnotationsDescription
tableNameString@NotNullName of the table to drop

Returns: CompletableFuture<Integer> — completes with the number of affected tables or exceptionally on error


columnExists

CompletableFuture<Boolean> columnExists(@NotNull String tableName, @NotNull String columnName);

Check if a column in a specific table exists

ParameterTypeAnnotationsDescription
tableNameString@NotNullName of the table to check
columnNameString@NotNullName of the column to be checked

Returns: CompletableFuture<Boolean> — completes with true when the column exists, false when the column does not exist or exceptionally on error


indexExists

CompletableFuture<Boolean> indexExists(@NotNull String tableName, @NotNull String indexName);

Check if an index in a specific table exists

ParameterTypeAnnotationsDescription
tableNameString@NotNullName of the table to check
indexNameString@NotNullName of the index to be checked

Returns: CompletableFuture<Boolean> — completes with true when the index exists, false when the index does not exist or exceptionally on error



Back to top

Copyright © 2026 Mr_Tesz. All rights reserved

This site uses Just the Docs, a documentation theme for Jekyll.