Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isPartitionKey field for columns #419

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/dialect/cql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export default class CQLDialect extends GenericDialect<CassandraLib.Client> impl
type: obj.type,
isNullable: obj.kind === 'regular',
isPk: obj.kind !== 'regular',
isPartitionKey: obj.kind === 'partition_key',
tableSchema: obj.keyspace_name,
tree: [obj.keyspace_name, 'tables', obj.table_name, obj.column_name].join(TREE_SEP)
};
Expand Down
1 change: 1 addition & 0 deletions packages/core/plugin-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export namespace DatabaseInterface {
tableCatalog?: string;
defaultValue?: string;
isNullable: boolean;
isPartitionKey?: boolean;
isPk?: boolean;
isFk?: boolean;
columnKey?: string;
Expand Down
4 changes: 4 additions & 0 deletions packages/extension/icons/partition-key-dark.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/extension/icons/partition-key-light.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default class SidebarColumn extends SidebarAbstractItem<null> {
dark: context.asAbsolutePath('icons/fk-dark.svg'),
light: context.asAbsolutePath('icons/fk-light.svg'),
},
partitionKey: {
dark: context.asAbsolutePath('icons/partition-key-dark.svg'),
light: context.asAbsolutePath('icons/partition-key-light.svg'),
},
};
}
this.updateIconPath();
Expand All @@ -46,7 +50,10 @@ export default class SidebarColumn extends SidebarAbstractItem<null> {
}
public updateIconPath() {
this.iconPath = SidebarColumn.icons.default;
if (this.column.isPk) {
if (this.column.isPartitionKey) {
this.iconPath = SidebarColumn.icons.partitionKey;
}
else if (this.column.isPk) {
this.iconPath = SidebarColumn.icons.primaryKey;
}
else if (this.column.isFk) {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,11 @@
"@types/minimatch" "*"
"@types/node" "*"

"@types/ibm_db@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@types/ibm_db/-/ibm_db-2.0.5.tgz#6804bb7f4b3ed5018ed2db54755ac37ae482f9cb"
integrity sha512-Tb4CRJ4xz+iwixGMjV0WJ5612WZBot/zwYMti/kRmnSLM6K0Wk57yuw+hyjAq9NJp5rY9tHQVzhDzkxh9QuQqQ==

"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
Expand Down