confluentinc / confluentinc/vscode

Handle SET, USE statements in Flink

Open
#1,560 0 comments 0 reactions 3 assignees Claimed by @noeldevelops View on GitHub
Flink
Dominant language
TypeScript
Stars
34
Forks
17
Avg merge
1d 22h
Merged PRs (30d)
8

Description

For more information, see internal wiki doc titled `Specification for SQL Clients`

SET & USE statements change how we parse/submit statement & setup intellisense.

["submit Flink statement" task](https://github.com/confluentinc/vscode/issues/1499) would love to have a function along lines of:

```
export interface IFlinkSpecProperties {
currentCatalog: string?
currentDatabase: string?
localTimezone: string?
}

extractStatementDefaults(documentUri: vscode.Uri): IFlinkSpecProperties {
/// ... magic goes here
}
```

which would use Any Means Necessary to 'parse' out USE statements within the current text of the document (via `getEditorOrFileContents()`) and return the above sort of structured result for us to then use when submitting the Flink statement (needed in the `statement.spec.properties` block).

Proof-of-concept simple best-case-scenario parsing will get us started, and is all that is asked for in this ticket.

... and will also need to return modified / "parsed" statement body containing only what we should submit as the SQL statement body (i.e. with SET fragments removed). And if / when we want to support multi-statement submissions (@shouples ), would then be promoted to [] of statement bodies.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.