Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
@Slf4j
public class OracleActionHandler extends BaseActionHandler {

@Override
public List<Action> getSchemaActions(TreeNode node) {
return List.of(
Action.builder()
.label(MessageUtils.get("Refresh"))
.key("refresh_node")
.divided(true)
.icon("el-icon-refresh")
.build(),
Action.builder()
.label(MessageUtils.get("NewQuery"))
.key("new_query")
.icon("el-icon-search")
.build(),
Action.builder()
.label(MessageUtils.get("ShowProperties"))
.key("show_properties")
.icon("fa fa-align-justify")
.build()
);
}

@Override
public List<Action> getTableActions(TreeNode node) {
return List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import org.jumpserver.chen.framework.datasource.metadata.RelationMetadata;
import org.jumpserver.chen.framework.datasource.metadata.RelationScope;
import org.jumpserver.chen.framework.datasource.metadata.SchemaMetadata;
import org.jumpserver.chen.framework.datasource.metadata.ScopeKind;
import org.jumpserver.chen.framework.datasource.metadata.ScopeProperties;
import org.jumpserver.chen.framework.datasource.metadata.ScopeRef;

import java.sql.SQLException;
import java.util.ArrayList;
Expand Down Expand Up @@ -223,11 +226,25 @@ public List<ObjectStatistics> listStatistics(RelationScope scope) throws SQLExce
WHERE OWNER = ? AND TABLE_NAME = ? AND TABLESPACE_NAME IS NOT NULL
""";

private static final String SQL_SCHEMA_PROPERTIES = """
SELECT USERNAME, USER_ID, CREATED
FROM ALL_USERS
WHERE USERNAME = ?
""";

@Override
public ObjectProperties objectProperties(ObjectRef ref) throws SQLException {
return loadObjectProperties(ref, SQL_TABLE_PROPERTIES);
}

@Override
public ScopeProperties scopeProperties(ScopeRef ref) throws SQLException {
if (ref.kind() != ScopeKind.SCHEMA) {
return super.scopeProperties(ref);
}
return loadScopeProperties(ref, SQL_SCHEMA_PROPERTIES, List.of(ref.scope().schema()));
}

private static final String SQL_PRIMARY_KEYS = """
SELECT c.table_name AS table_name, cc.column_name AS column_name, c.constraint_name AS name
FROM all_constraints c
Expand Down