Skip to content

Commit

Permalink
Merge branch 'main' of github.com:halcyon-tech/vscode-db2i
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Aug 27, 2024
2 parents 1110b4e + 879652d commit ab9f878
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/database/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ import { getInstance } from "../base";

import { JobManager } from "../config";

export type SQLType = "schemas" | "tables" | "views" | "aliases" | "constraints" | "functions" | "variables" | "indexes" | "procedures" | "sequences" | "packages" | "triggers" | "types";
export type SQLType = "schemas" | "tables" | "views" | "aliases" | "constraints" | "functions" | "variables" | "indexes" | "procedures" | "sequences" | "packages" | "triggers" | "types" | "logicals";
type PageData = { filter?: string, offset?: number, limit?: number };

const typeMap = {
'tables': [`T`, `P`, `M`],
'views': [`V`],
'aliases': [`A`]
'aliases': [`A`],
'logicals': [`L`],
};

export const AllSQLTypes: SQLType[] = ["tables", "views", "aliases", "constraints", "functions", "variables", "indexes", "procedures", "sequences", "packages", "triggers", "types"];
export const AllSQLTypes: SQLType[] = ["tables", "views", "aliases", "constraints", "functions", "variables", "indexes", "procedures", "sequences", "packages", "triggers", "types", "logicals"];

export const SQL_ESCAPE_CHAR = `\\`;

Expand Down Expand Up @@ -74,6 +75,7 @@ export default class Schemas {
case `tables`:
case `views`:
case `aliases`:
case `logicals`:
filter = getFilterClause(`TABLE_NAME`, details.filter);
selects.push([
`select '${type}' as OBJ_TYPE, TABLE_NAME as NAME, TABLE_TEXT as TEXT, SYSTEM_TABLE_NAME as SYS_NAME, SYSTEM_TABLE_SCHEMA as SYS_SCHEMA, '' as SPECNAME, BASE_TABLE_SCHEMA as BASE_SCHEMA, BASE_TABLE_NAME as BASE_OBJ`,
Expand Down
7 changes: 5 additions & 2 deletions src/views/schemaBrowser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const viewItem = {
"sequences": `sequence`,
"packages": `package`,
"triggers": `trigger`,
"types": `type`
"types": `type`,
"logicals": `logical`
}

const itemIcons = {
Expand All @@ -36,7 +37,8 @@ const itemIcons = {
"type": `symbol-parameter`,
"trigger": `play`,
"variable": `symbol-value`,
"index": `list-tree`
"index": `list-tree`,
"logical": `symbol-interface`
}

export default class schemaBrowser {
Expand Down Expand Up @@ -606,6 +608,7 @@ const getSchemaItems = (schema) => {
new SchemaItem(`Aliases`, `aliases`, schema, `symbol-reference`),
//new SchemaItem(`Column Masks`, `masks`, schema),
//new SchemaItem(`Constraints`, `constraints`, schema),
new SchemaItem(`Logicals`, `logicals`, schema, `telescope`),
new SchemaItem(`Functions`, `functions`, schema, `symbol-function`),
new SchemaItem(`Global Variables`, `variables`, schema, `symbol-variable`),
new SchemaItem(`Indexes`, `indexes`, schema, `tag`),
Expand Down

0 comments on commit ab9f878

Please sign in to comment.