From ee8f72b67a8550e130e95c28f89e4284843ee148 Mon Sep 17 00:00:00 2001 From: Scott Forstie Date: Thu, 11 Jun 2026 19:53:37 -0500 Subject: [PATCH 1/2] fix: column autocomplete for SYSTEM_TABLE_NAME references (#421) When a user references a table by its system (short) name in SQL, e.g. FROM QSYS2.AUTH_COL instead of FROM QSYS2.AUTHORITY_COLLECTION, the column lookup in Table.getItems() failed to return any columns because the WHERE clause only matched TABLE_NAME. Extend the WHERE predicate to also match SYSTEM_TABLE_NAME so both the long SQL name and the short system name resolve to column metadata. --- src/database/table.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/table.ts b/src/database/table.ts index 72d1adac..80d4b08f 100644 --- a/src/database/table.ts +++ b/src/database/table.ts @@ -11,7 +11,7 @@ export default class Table { * @returns {Promise} */ static async getItems(schema: string, table?: string): Promise { - const params = table ? [schema, table] : [schema]; + const params = table ? [schema, table, table] : [schema]; const sql = [ `SELECT `, ` column.TABLE_SCHEMA,`, @@ -36,7 +36,7 @@ export default class Table { ` column.column_name = key.column_name`, `WHERE column.TABLE_SCHEMA = ?`, ...[ - table ? `AND column.TABLE_NAME = ?` : ``, + table ? `AND (column.TABLE_NAME = ? OR column.SYSTEM_TABLE_NAME = ?)` : ``, ], `ORDER BY column.ORDINAL_POSITION`, ].join(` `); From e55963447def7d56a0dcc677365fb06534f77222 Mon Sep 17 00:00:00 2001 From: Scott Forstie Date: Thu, 11 Jun 2026 19:55:54 -0500 Subject: [PATCH 2/2] chore: ensure package.json ends with newline --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3ffc0b41..78405554 100644 --- a/package.json +++ b/package.json @@ -1937,4 +1937,4 @@ "showdown": "^2.1.0", "sql-formatter": "^14.0.0" } -} +} \ No newline at end of file