Skip to content

Commit 08c07f2

Browse files
prmoore77claude
andcommitted
feat: Use SQL functions instead of GetSqlInfo for instrumentation discovery
Replace getSqlInfo() with a standard SQL query using GIZMOSQL_INSTRUMENTATION_ENABLED(), GIZMOSQL_INSTRUMENTATION_CATALOG(), and GIZMOSQL_INSTRUMENTATION_SCHEMA() functions. This avoids JDBC driver compatibility issues with custom SqlInfo IDs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 47a96af commit 08c07f2

File tree

4 files changed

+39
-19
lines changed

4 files changed

+39
-19
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
All notable changes to GizmoSQL UI will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.4.0] - 2026-02-11
9+
10+
### Added
11+
12+
- **Admin screen** for monitoring active sessions, SQL statements, and server instrumentation data
13+
- **Kill Session** modal for administrators to terminate active sessions
14+
- **OAuth/SSO login** support in the Add Server dialog (`authType: oauth`)
15+
- OAuth discovery, initiation, and polling API routes (`/api/oauth/discover`, `/api/oauth/initiate`, `/api/oauth/poll`)
16+
- Server info API route (`/api/server-info`)
17+
- SQL functions for instrumentation metadata discovery (`GIZMOSQL_INSTRUMENTATION_ENABLED()`, `GIZMOSQL_INSTRUMENTATION_CATALOG()`, `GIZMOSQL_INSTRUMENTATION_SCHEMA()`)
18+
- Table details modal with column metadata viewer
19+
- Text viewer modal for inspecting long SQL statements and values
20+
21+
### Changed
22+
23+
- Instrumentation discovery now uses standard SQL queries instead of `GetSqlInfo` for broader client compatibility

lib/services/gizmosql.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FlightSQLClient, GIZMOSQL_SQL_INFO } from '@gizmodata/gizmosql-client';
1+
import { FlightSQLClient } from '@gizmodata/gizmosql-client';
22
import { InstrumentationInfo } from '@/lib/types';
33

44
export interface GizmoSQLConfig {
@@ -218,24 +218,21 @@ export class GizmoSQLService {
218218

219219
return this.queueQuery(async () => {
220220
try {
221-
const sqlInfoIds = [
222-
GIZMOSQL_SQL_INFO.INSTRUMENTATION_ENABLED,
223-
GIZMOSQL_SQL_INFO.INSTRUMENTATION_CATALOG,
224-
GIZMOSQL_SQL_INFO.INSTRUMENTATION_SCHEMA,
225-
];
226-
const info = await this.client!.getSqlInfo(sqlInfoIds);
227-
228-
const enabled = info.get(GIZMOSQL_SQL_INFO.INSTRUMENTATION_ENABLED);
229-
const catalog = info.get(GIZMOSQL_SQL_INFO.INSTRUMENTATION_CATALOG);
230-
const schema = info.get(GIZMOSQL_SQL_INFO.INSTRUMENTATION_SCHEMA);
231-
232-
if (typeof enabled !== 'boolean') {
233-
// Server doesn't support custom SqlInfo IDs (older version)
221+
const sql =
222+
'SELECT GIZMOSQL_INSTRUMENTATION_ENABLED() AS enabled,' +
223+
' GIZMOSQL_INSTRUMENTATION_CATALOG() AS catalog,' +
224+
' GIZMOSQL_INSTRUMENTATION_SCHEMA() AS schema';
225+
const table = await this.client!.execute(sql);
226+
const rows = table.toArray();
227+
228+
if (rows.length === 0) {
234229
return null;
235230
}
236231

237-
const catalogStr = String(catalog || '');
238-
const schemaStr = String(schema || '');
232+
const row = rows[0];
233+
const enabled = Boolean(row.enabled);
234+
const catalogStr = String(row.catalog || '');
235+
const schemaStr = String(row.schema || '');
239236

240237
return {
241238
enabled,
@@ -244,7 +241,7 @@ export class GizmoSQLService {
244241
qualifiedPrefix: catalogStr && schemaStr ? `${catalogStr}.${schemaStr}` : '',
245242
};
246243
} catch {
247-
// Older servers may not support GetSqlInfo with custom IDs
244+
// Older servers may not support GIZMOSQL_INSTRUMENTATION_*() functions
248245
return null;
249246
}
250247
});

lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Instrumentation metadata (discovered via GetSqlInfo)
1+
// Instrumentation metadata (discovered via SQL functions)
22
export interface InstrumentationInfo {
33
enabled: boolean;
44
catalog: string;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gizmosql-ui",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "GizmoSQL UI - A web-based SQL interface for GizmoSQL servers",
55
"private": true,
66
"bin": "launcher.js",

0 commit comments

Comments
 (0)