mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-153 Batch update API
This commit is contained in:
@@ -103,6 +103,11 @@ type SQLExecuteInfo {
|
||||
results: [ SQLQueryResults! ]!
|
||||
}
|
||||
|
||||
input SQLResultRow {
|
||||
data: [ Object ]!
|
||||
updateValues: [ Object ]
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
|
||||
sqlDialectInfo( connectionId: ID! ): SQLDialectInfo
|
||||
@@ -152,6 +157,16 @@ extend type Mutation {
|
||||
updateValues: Object
|
||||
): SQLExecuteInfo
|
||||
|
||||
updateResultsDataBatch(
|
||||
connectionId: ID!,
|
||||
contextId: ID!,
|
||||
resultsId: ID!,
|
||||
|
||||
updatedRows: [ SQLResultRow ],
|
||||
deletedRows: [ SQLResultRow ],
|
||||
addedRows: [ SQLResultRow ],
|
||||
): SQLExecuteInfo
|
||||
|
||||
### Async API
|
||||
|
||||
# Returns SQLExecuteInfo
|
||||
|
||||
+7
-2
@@ -23,8 +23,6 @@ import io.cloudbeaver.model.WebAsyncTaskInfo;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
|
||||
import org.jkiss.dbeaver.model.struct.DBSDataContainer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -66,6 +64,13 @@ public interface DBWServiceSQL extends DBWService {
|
||||
@NotNull List<Object> updateRow,
|
||||
@NotNull Map<String, Object> updateValues) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
WebSQLExecuteInfo updateResultsDataBatch(
|
||||
@NotNull WebSQLContextInfo contextInfo,
|
||||
@NotNull String resultsId,
|
||||
@NotNull List<Object> updateRow,
|
||||
@NotNull Map<String, Object> updateValues) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
WebAsyncTaskInfo asyncExecuteQuery(@NotNull WebSQLContextInfo contextInfo, @NotNull String sql, @Nullable WebSQLDataFilter filter) throws DBException;
|
||||
}
|
||||
|
||||
+5
@@ -143,6 +143,11 @@ public class WebServiceSQL implements DBWServiceSQL {
|
||||
return contextInfo.getProcessor().updateResultsData(contextInfo, resultsId, updateRow, updateValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebSQLExecuteInfo updateResultsDataBatch(@NotNull WebSQLContextInfo contextInfo, @NotNull String resultsId, @NotNull List<Object> updateRow, @NotNull Map<String, Object> updateValues) throws DBWebException {
|
||||
throw new DBWebException("Not supported");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public WebAsyncTaskInfo asyncExecuteQuery(@NotNull WebSQLContextInfo contextInfo, @NotNull String sql, @Nullable WebSQLDataFilter filter) throws DBException {
|
||||
DBRRunnableWithResult<WebSQLExecuteInfo> runnable = new DBRRunnableWithResult<WebSQLExecuteInfo>() {
|
||||
|
||||
Reference in New Issue
Block a user