aktin / aktin/apikey-manager-gui

Query Builder: run the assembled query against a test Postgres database

Open
#45 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vue
Stars
0
Forks
0
Avg merge
3m
Merged PRs (30d)
1

Description

## Context

The query builder (`src/querybuilder/QueryBuilderView.vue`) currently offers two actions on the XML preview: copy to clipboard and download as XML. To iterate on a query it must be exported and executed manually against an AKTIN i2b2 database. A direct run against a local test database (e.g. a Docker container) would shorten this loop considerably.

## Proposal

### Configuration

Add a new collapsible section "Test database" to the configuration dialog (`src/profiles/BrokerProfileManager.vue`). It holds:

- Postgres connection settings (host, port, database, user, password) for an AKTIN i2b2 database.
- A start date and an end date used to substitute the `${data.start}` and `${data.end}` placeholders.

No validation of the target schema is required for a first version. The user enters the connection data and is responsible for pointing it at a suitable database.

### Query Builder

- Remove the "Copy query" (clipboard) button. Download as XML stays.
- Add a "Run" button in its place.
- On click, the assembled XML is taken, `${data.start}` and `${data.end}` are replaced with the values from the test configuration, and the resulting SQL is executed against the configured Postgres database.
- The button is disabled when no test database is configured.

### Result output

Open question. The UI should not become cluttered by a result grid. A pragmatic first step is to write the result to a text file in the app's data directory (next to the saved queries) and show a toast with the path. Alternatives can be discussed in this issue.

## Notes

- Execution has to go through the Electron main process (IPC), since the renderer must not open database connections. This requires a Postgres client dependency in the main process.
- Credentials for the test database should be stored the same way as broker profiles (encrypted profile storage).

## Acceptance criteria

- Collapsible "Test database" section in the configuration with connection settings plus start and end date.
- "Copy query" button removed, "Run" button added.
- Run substitutes both placeholders and executes the query via IPC.
- Result is persisted as a text file and the user is notified; errors are shown as a toast.
- Locale strings exist for de and en.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.