SyncDBManager

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

Description

Parent interface of all sync database managers


Methods

createOrAlter

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

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


executeSql

int executeSql(@NotNull String sql, @NotNull String tableName, @Nullable String type);
int 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: int - the number of affected rows


executeSelect

SelectionResults executeSelect(@NotNull String sql, @NotNull List<Object> sqlParams, @NotNull String tableName);
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: SelectionResults — the query results represented as a <abbr title=io.github.mrtesz.teszcore.db.selection.SelectionResults>SelectionResults</abbr> Object


insertInto

int 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: int — the number of affected rows


insertIgnore

int 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: int — the number of affected rows


deleteFrom

int deleteFrom(@NotNull String tableName, @Nullable String whereClause, @NotNull List<Object> whereParams);
int 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: int — the number of affected rows


update

int update(@NotNull String tableName, @NotNull Map<String, Object> values, @Nullable String whereClause, @NotNull List<Object> whereParams);
int 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: int — the number of affected rows


dropTable

int dropTable(@NotNull String tableName);

Drop a table

ParameterTypeAnnotationsDescription
tableNameString@NotNullName of the table to drop

Returns: int — the number of affected tables


columnExists

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: boolean — true when the column exists


indexExists

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: boolean — true when the index exists



Back to top

Copyright © 2026 Mr_Tesz. All rights reserved

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