From 200d95f2d3e3bc2f84dd3eb9aa099ba6e4adc3af Mon Sep 17 00:00:00 2001 From: Mark Marlow Date: Mon, 29 Jun 2026 13:22:43 +1000 Subject: [PATCH] added default database to be passed through to TeraDriver --- connection.schema.json | 6 ++++++ src/ls/driver.ts | 1 + ui.schema.json | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/connection.schema.json b/connection.schema.json index 82bf0f9..1c57dd6 100644 --- a/connection.schema.json +++ b/connection.schema.json @@ -38,11 +38,17 @@ "title": "Show Users as DBs", "type": "boolean", "default": false + }, + "defaultDatabase": { + "title": "Default Database", + "type": "string", + "minLength": 1 } }, "properties": { "server": { "$ref": "#/definitions/server" }, "port": { "$ref": "#/definitions/port" }, + "defaultDatabase": { "$ref": "#/definitions/defaultDatabase" }, "username": { "$ref": "#/definitions/username" }, "usePassword": { "$ref": "#/definitions/usePassword" }, "tdsqlpreferences": { diff --git a/src/ls/driver.ts b/src/ls/driver.ts index 8742de3..5c6132a 100644 --- a/src/ls/driver.ts +++ b/src/ls/driver.ts @@ -77,6 +77,7 @@ export default class TeraDriver encryptdata: this.credentials.tdsqloptions.encryptdata.toString(), dbs_port: this.credentials.port.toString(), tmode: this.credentials.tdsqloptions.tmode, + database: this.credentials.defaultDatabase }; this.connection = Promise.resolve( await teradata_connect(connector_params).catch((e) => { diff --git a/ui.schema.json b/ui.schema.json index 2cf18d0..27c60c2 100644 --- a/ui.schema.json +++ b/ui.schema.json @@ -2,6 +2,7 @@ "ui:order": [ "server", "port", + "defaultDatabase", "username", "usePassword", "password", @@ -20,6 +21,9 @@ }, "tmode": { "ui:help": "The mode used to connect to Teradata server" + }, + "defaultDatabase": { + "ui:help": "Optional. Sets the initial database context for the session" } } }