Skip to content

Commit

Permalink
CB-5617 disable array editing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-skoblikov committed Sep 4, 2024
1 parent 7b5c10b commit 549a1dd
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,10 @@ public Object convertInputCellValue(DBCSession session, DBDAttributeBinding upda
cellRawValue,
false,
true);
//FIXME: fix array editing for nosql databases
if (realCellValue == null && cellRawValue != null && updateAttribute.getDataKind() == DBPDataKind.ARRAY) {
throw new DBCException("Array update is not supported");
}
} catch (DBCException e) {
//checks if this function is used only for script generation
if (justGenerateScript) {
Expand Down Expand Up @@ -1140,7 +1144,8 @@ private static DBCExecutionPurpose resolveQueryPurpose(DBDDataFilter filter) {
return filter.hasFilters() ? DBCExecutionPurpose.USER_FILTERED : DBCExecutionPurpose.USER;
}

private Object setCellRowValue(Object cellRow, WebSession webSession, DBCSession dbcSession, DBDAttributeBinding allAttributes, boolean withoutExecution) {
private Object setCellRowValue(Object cellRow, WebSession webSession, DBCSession dbcSession, DBDAttributeBinding allAttributes, boolean withoutExecution)

Check warning on line 1147 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java

View check run for this annotation

Jenkins-CI-integration / CheckStyle Java Report

server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java#L1147

Line is longer than 140 characters (found 157).
throws DBException {

Check warning on line 1148 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java

View check run for this annotation

Jenkins-CI-integration / CheckStyle Java Report

server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLProcessor.java#L1148

throws has incorrect indentation level 8, expected level should be 12.
if (cellRow instanceof Map<?, ?>) {
Map<String, Object> variables = (Map<String, Object>) cellRow;
if (variables.get(FILE_ID) != null) {
Expand All @@ -1153,14 +1158,14 @@ private Object setCellRowValue(Object cellRow, WebSession webSession, DBCSession
var file = Files.newInputStream(path);
return convertInputCellValue(dbcSession, allAttributes, file, withoutExecution);
} catch (IOException | DBCException e) {
return new DBException(e.getMessage());
throw new DBException(e.getMessage());
}
}
}
try {
return convertInputCellValue(dbcSession, allAttributes, cellRow, withoutExecution);
} catch (DBCException e) {
return new DBException(e.getMessage());
throw new DBException(e.getMessage());
}
}
}

0 comments on commit 549a1dd

Please sign in to comment.