Skip to content

Commit

Permalink
dbeaver#22963 Fix constraint type in CubridMetaModel.java file
Browse files Browse the repository at this point in the history
  • Loading branch information
longhaseng52 committed Mar 21, 2024
1 parent 3aa2618 commit 22253fb
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ public JDBCStatement prepareTableColumnLoadStatement(
return dbStat;
}

@NotNull
@Override
public boolean supportsUniqueKeys() {
return true;
}

@NotNull
@Override
public JDBCStatement prepareUniqueConstraintsLoadStatement(
Expand Down Expand Up @@ -151,17 +157,14 @@ public GenericTableConstraintColumn[] createConstraintColumnsImpl(
new GenericTableConstraintColumn(object, tableColumn, keyOrder) };
}

@Nullable
@NotNull
@Override
public DBSEntityConstraintType getUniqueConstraintType(@NotNull JDBCResultSet dbResult) throws DBException {
String isUnique = JDBCUtils.safeGetString(dbResult, "is_unique");
String isPrimary = JDBCUtils.safeGetString(dbResult, "is_primary_key");
if(isPrimary.equals("YES")) {
return DBSEntityConstraintType.PRIMARY_KEY;
} else if (isUnique.equals("YES")) {
return DBSEntityConstraintType.UNIQUE_KEY;
} else {
return null;
return DBSEntityConstraintType.UNIQUE_KEY;
}
}

Expand Down

0 comments on commit 22253fb

Please sign in to comment.