From 3ce2d6dc7231cb02efd57bbbc96cf90d49421d3a Mon Sep 17 00:00:00 2001 From: worksofliam Date: Tue, 27 Aug 2024 10:23:14 -0400 Subject: [PATCH] Logicals available from the Schema Browser Signed-off-by: worksofliam --- src/database/schemas.ts | 8 +++++--- src/views/schemaBrowser/index.ts | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/database/schemas.ts b/src/database/schemas.ts index 8ba9dba6..6e97aa48 100644 --- a/src/database/schemas.ts +++ b/src/database/schemas.ts @@ -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 = `\\`; @@ -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`, diff --git a/src/views/schemaBrowser/index.ts b/src/views/schemaBrowser/index.ts index 8f2eec37..4503ced3 100644 --- a/src/views/schemaBrowser/index.ts +++ b/src/views/schemaBrowser/index.ts @@ -24,7 +24,8 @@ const viewItem = { "sequences": `sequence`, "packages": `package`, "triggers": `trigger`, - "types": `type` + "types": `type`, + "logicals": `logical` } const itemIcons = { @@ -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 { @@ -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`),