Skip to content

Commit 83305a1

Browse files
Merge pull request #556 from KxSystems/v.1.11.0-dev-to-main
V.1.11.0 dev to main
2 parents 6a5f6cf + e6bf833 commit 83305a1

File tree

117 files changed

+7426
-1199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+7426
-1199
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
All notable changes to the **kdb VS Code extension** are documented in this file.
44

5+
# v1.11.0
6+
7+
### Enhancements
8+
9+
- Added UDA tab to the Datasource Files
10+
- Added the **Reset Scratchpad** option for insights connections version 1.13 or higher
11+
- Allow users to create custom authentication logic
12+
- Improved language server performance and resource usage
13+
- Support Query Environment Enabled for Insights connections.
14+
15+
### Fixes
16+
17+
- Fixed kdb results view theme issue
18+
- Fixed case insensitivity for connection labels
19+
20+
### Internal Improvements
21+
22+
- Improved ESlint rules for the codebase
23+
- Merged PyKX kdb+ structuredText changes
24+
525
# v1.10.2
626

727
### Fixes

README.md

Lines changed: 112 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Once the **kdb VS Code extension** is installed **KX** appears in the Activity B
6262
- [Workbooks](#workbooks)
6363
- [Query History](#query-history)
6464

65+
**Note** Customized authentication has been implemented for the kdb VS Code extension, allowing you to add custom logic when authenticating with kdb. Refer to [customized authentication](https://github.com/KxSystems/kx-vscode-auth) for details on how to set this up.
66+
6567
### Installing q
6668

6769
After you install **kdb VS Code extension**, if q is not already installed the extension provides a seamless integration with q, by displaying a notification with an option to download, register and install [kdb Insights Personal Edition](https://kx.com/kdb-insights-personal-edition-license-download/). For details on the other versions available see [here](#versions-available).
@@ -79,8 +81,6 @@ After you install **kdb VS Code extension**, if q is not already installed the e
7981

8082
Once registered you will receive an email with you license details. The base64 encoded license string can be found in the welcome email received after registration, under the download link for the license file.
8183

82-
![welcomeemaillicense](https://github.com/KxSystems/kx-vscode/blob/main/img/weclomeemail.jpg?raw=true)
83-
8484
With your license details to hand, you can link this to VS Code by either choosing **Paste license string** or **Select license file** from your PC. The latter method is recommended for new users.
8585

8686
![findlicense](https://github.com/KxSystems/kx-vscode/blob/main/img/pastelicense.jpg?raw=true)
@@ -104,7 +104,7 @@ There are commercial and non-commercial editions available. We recommend you sta
104104
| Edition | write q | run q queries | explore results | shared kdb process with kdb Insights |
105105
| ----------------------------------------------------------------------------------------------- | ------- | ------------- | --------------- | ------------------------------------ |
106106
| [kdb+ Personal Edition](https://kx.com/kdb-personal-edition-download/) | yes | yes | yes | no |
107-
| [kdb Insights Personal Edition](https://kx.com/kdb-insights-personal-edition-license-download/) | yes | yes | yes | no |
107+
| [kdb Insights SDK Personal Edition](https://kx.com/kdb-insights-sdk-personal-edition-download/) | yes | yes | yes | no |
108108
| **kdb Insights Enterprise** | yes | yes | yes | yes |
109109

110110
> **kdb Insights Enterprise** requires a commercial license. Please contact licadmin@kx.com for further information.
@@ -218,7 +218,7 @@ If you close the extension, the connection also closes.
218218

219219
#### Meta
220220

221-
When connected **Insights** connections can be expanded to show the details returned by the [getMeta API](https://code.kx.com/draft/insights/api/database/query/get-meta.html) call, which provides information on the database schemas and all the analytics available.
221+
When connected **Insights** connections can be expanded to show the details returned by the [getMeta API](https://code.kx.com/insights/api/database/query/get-meta.html) call, which provides information on the database schemas and all the analytics available.
222222

223223
![Insights Meta Tree](https://github.com/KxSystems/kx-vscode/blob/main/img/insights-meta-tree.png?raw=true)
224224

@@ -490,7 +490,92 @@ To create a data source and run it against a specific connection:
490490

491491
In addition to [API queries](https://code.kx.com/insights/api/database/query/get-data.html), if the query environment is enabled on the deployed instance of **kdb Insights Enterprise**, qSQL and SQL queries can be used within a data source with the appropriate parameterization. If qSQL or SQL is required and issues occur trying to run these queries contact a kdb Insights Enterprise administrator for assistance.
492492

493-
### Populate scratchpad
493+
### API queries
494+
495+
The getData API provides a method of querying a table using a defined set of parameters. These parameters can be configured through the getData form available in the VSCode extension.
496+
497+
Refer to the [`getData` API](https://code.kx.com/insights/api/database/query/get-data.html) documentation for more information and a full list of available parameters.
498+
499+
### QSQL queries
500+
501+
The `.com_kx_edi.qsql` API is a QSQL query builder that assembles QSQL queries based on a q expression. It is a developer tool that allows running freeform q code against a specific database tier.
502+
503+
This function runs an QSQL query.
504+
505+
```
506+
.com_kx_edi.qsql[args]
507+
```
508+
509+
**Note**: Along with the query itself, you must also specify the target database and tier.
510+
511+
Refer to the [QSQL documentation](https://code.kx.com/insights/api/database/query/qsql.html) for more details.
512+
513+
**Warning!** Starting with kdb Insights Enterprise version 1.13, QSQL queries and populating QSQL only work if the Query Environment (QE) is enabled. Ensure you have enabled QEs to use QSQL; they are disabled by default in kdb VS Code. Refer to [Query Environments](https://code.kx.com/insights/enterprise/configuration/base.html#query-environments) for more details.
514+
515+
### SQL queries
516+
517+
The `.com_kx_edi.sql` SQL API allows running freeform SQL queries. Each query is distributed across all available databases. The results are then aggregated and returned as a single dataset.
518+
519+
This function runs an SQL query.
520+
521+
```
522+
.com_kx_edi.sql[query]
523+
```
524+
525+
Refer to the [SQL documentation](https://code.kx.com/insights/api/database/query/sql.html) for more details.
526+
527+
### UDA queries
528+
529+
User-Defined Analytics (UDAs), also known as custom APIs, are essential for developers to leverage the capabilities of kdb when using Insights Enterprise. These UDAs are deployed to Insights through the Data Access Processes (DAPs) and Aggregators (Aggs).
530+
531+
UDAs can be called directly within the VSCode extension through the UDA tab in a data source. This provides a form-based approach to populating the UDA parameters. UDAs can also be called within the Insights Enterprise web interface using Pipelines, Queries, and Views.
532+
533+
![Query UDAs in VSCode extension](https://github.com/KxSystems/kx-vscode/blob/main/img/udas-query.png?raw=true)
534+
535+
When interacting with UDAs, parameter fields are shown for configuration. Note the following:
536+
537+
- Required fields are marked with an asterisk (*).
538+
539+
- Optional fields are not required but may be displayed in your results, even if they are empty.
540+
541+
You can add new parameters by clicking **Add Parameter**. Both optional and distinguished parameters can be added as needed.
542+
543+
![Add parameters to call UDAs](https://github.com/KxSystems/kx-vscode/blob/img/udas-add-parameters.png?raw=true)
544+
545+
**Important!** A UDA cannot be queried if one or more parameters are invalid.
546+
547+
If you attempt to run a UDA with invalid parameters, an error occurs and a pop-up message appears to alert you to the issue.
548+
549+
![Error showing invalid parameters for UDA](https://github.com/KxSystems/kx-vscode/blob/img/udas-invalid-parameter.png?raw=true)
550+
551+
![Pop-up message UDAs include invalid parameter](https://github.com/KxSystems/kx-vscode/blob/img/udas-error-pop-up.png?raw=true)
552+
553+
In some cases, you can successfully query UDAs without any parameters, as seen in the screenshot below.
554+
555+
![UDAs with no parameters](https://github.com/KxSystems/kx-vscode/blob/img/udas-no-parameters.png?raw=true)
556+
557+
However, you can still modify the parameter list to add parameters by clicking **Add parameter** or deleting parameters using the recycle bin icon.
558+
559+
![Delete UDA parameters](https://github.com/KxSystems/kx-vscode/blob/img/udas-delete-parameters.png?raw=true)
560+
561+
For more information on User-Defined Analytics, refer to the [UDAs documentation](https://code.kx.com/insights/api/database/uda/uda-overview-introduction.html).
562+
563+
### Run and populate scratchpad
564+
565+
Running and populating scratchpad are two actions used to execute q code, allowing you to run queries and perform operations on your kdb Insights Enterprise database but they differ in how and where the output is stored and accessed.
566+
567+
The [QSQL API](#qsql-queries) is designed to run queries against a specific Insights database and tier. However, sometimes you might need to run more flexible or freeform queries against a wider set of data. For this purpose each Insights Enterprise user is assigned a 'scratchpad' q process. This scratchpad is separate from the dedicated query processes, allowing you to run freeform code without impacting the overall system.
568+
569+
You can populate variables in your scratchpad with the results from your queries, and then perform freeform manipulations on those variables.
570+
571+
After you configure a data source in the VSCode extension you have two options for executing it:
572+
573+
- **Run** executes your query directly against the relevant API (getData, QSQL, SQL, or UDA) and displays the results in the extension
574+
- **Populate Scratchpad** executes your query through the scratchpad, which passes it to the relevant API, assigns the results to a variable of your choosing in your scratchpad process and then displays them in the VSCode extension
575+
576+
For more details on populating scratchpad, refer to the [populate scratchpad](#populate-scratchpad) section below.
577+
578+
#### Populate scratchpad
494579

495580
You can use a data source to populate a scratchpad process running in a **kdb Insights Enterprise** instance with a dataset. This allows you to then execute q or python code against the data stored in that variable in the scratchpad. This facilitates the generation of complex APIs and pipelines within VS Code and kdb Insights Enterprise.
496581

@@ -508,6 +593,26 @@ To do this:
508593

509594
1. Use a [Workbook](#workbooks) to execute q or Python code against the data in your scratchpad using the variable you provided.
510595

596+
### Reset scratchpad
597+
598+
The **Reset Scratchpad** option in kdb VS Code allows you to delete all the data from a connected instance and restart your development from scratch.
599+
600+
There are several ways to reset the scratchpad:
601+
602+
1. Right click on the appropriate connection on the left-hand side and select **Reset Scratchpad**. The connection can be either active or idle but it must be connected.
603+
604+
![Reset Scratchpad with right click on connected instance](https://github.com/KxSystems/kx-vscode/blob/main/img/reset-scratchpad-right-click.png?raw=true)
605+
606+
This displays a dialog box at the bottom right corner asking you to confirm your action.
607+
608+
![Dialog to confirm reset scratchpad](https://github.com/KxSystems/kx-vscode/blob/main/img/reset-scratchpad-dialog.png?raw=true)
609+
610+
2. Using the **Command Palette** in VSCode, start typing **Reset Scratchpad** and click on the option as it shows. This action resets the scratchpad for the active connection.
611+
612+
![Reset scratchpad using the Command Palette](https://github.com/KxSystems/kx-vscode/blob/main/img/reset-scratchpad-command-palette.png?raw=true)
613+
614+
3. Use the [MacOS or Windows shortcuts](#shortcuts) in the q file or in the workbook. Note that running the shortcuts in the q file resets the scratchpad for the active connection, while running them in the workbook resets the scratchpad for the connection chosen in the workbook.
615+
511616
## Workbooks
512617

513618
Workbooks provide a convenient way to prototype and execute q and python code against a q process and using the variables [populated into the scratchpad](#populate-scratchpad) of a **kdb Insights Enterprise** deployment by data sources.
@@ -755,6 +860,7 @@ The following setting will change double click behaviour to select the whole ide
755860
| Ctrl + Shift + D | Execute entire file |
756861
| Ctrl + Shift + R | Run q file in new q instance |
757862
| Ctrl + Shift + Y | Toggle paramater cache for lambda |
863+
| Ctrl + Shift + Delete | Reset scratchpad |
758864

759865
### For MacOS
760866

@@ -768,3 +874,4 @@ The following setting will change double click behaviour to select the whole ide
768874
| ⌘ + Shift + D | Execute entire file |
769875
| ⌘ + Shift + R | Run q file in new q instance |
770876
| ⌘ + Shift + Y | Toggle paramater cache for lambda |
877+
| ⌘ + Shift + Delete | Reset scratchpad |

eslint.config.cjs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
const js = require("@eslint/js");
2+
const tseslint = require("typescript-eslint");
3+
const headerPlugin = require("eslint-plugin-header");
4+
const licenseHeaderPlugin = require("eslint-plugin-license-header");
5+
const unusedImportsPlugin = require("eslint-plugin-unused-imports");
6+
const importPlugin = require("eslint-plugin-import");
7+
8+
const currentYear = new Date().getFullYear();
9+
10+
module.exports = [
11+
{
12+
ignores: ["**/*.d.ts", "**/*.js", "src/ipc/**"],
13+
},
14+
js.configs.recommended,
15+
...tseslint.configs.recommended,
16+
{
17+
languageOptions: {
18+
parser: tseslint.parser,
19+
parserOptions: {
20+
ecmaVersion: 2018,
21+
sourceType: "module",
22+
},
23+
},
24+
plugins: {
25+
header: headerPlugin,
26+
import: importPlugin,
27+
"license-header": licenseHeaderPlugin,
28+
"unused-imports": unusedImportsPlugin,
29+
},
30+
rules: {
31+
"@typescript-eslint/no-use-before-define": "off",
32+
"@typescript-eslint/explicit-function-return-type": "off",
33+
"@typescript-eslint/no-non-null-assertion": "off",
34+
"@typescript-eslint/explicit-module-boundary-types": "off",
35+
"@typescript-eslint/no-explicit-any": "off",
36+
"license-header/header": [
37+
"error",
38+
[
39+
"/*",
40+
` * Copyright (c) 1998-${currentYear} Kx Systems Inc.`,
41+
" *",
42+
' * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the',
43+
" * License. You may obtain a copy of the License at",
44+
" *",
45+
" * http://www.apache.org/licenses/LICENSE-2.0",
46+
" *",
47+
" * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an",
48+
' * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the',
49+
" * specific language governing permissions and limitations under the License.",
50+
" */",
51+
],
52+
],
53+
"import/order": [
54+
"error",
55+
{
56+
groups: [
57+
["builtin", "external"],
58+
["internal", "parent", "sibling", "index"],
59+
],
60+
"newlines-between": "always",
61+
alphabetize: { order: "asc", caseInsensitive: true },
62+
},
63+
],
64+
"@typescript-eslint/no-unused-vars": "off",
65+
"unused-imports/no-unused-imports": "error",
66+
"unused-imports/no-unused-vars": [
67+
"warn",
68+
{
69+
vars: "all",
70+
varsIgnorePattern: "^_",
71+
args: "after-used",
72+
argsIgnorePattern: "^_",
73+
},
74+
],
75+
},
76+
},
77+
];
14.1 KB
Loading

img/reset-scratchpad-dialog.png

10.3 KB
Loading
15.4 KB
Loading

img/udas-add-parameters.png

32.1 KB
Loading

img/udas-delete-parameters.png

48 KB
Loading

img/udas-error-pop-up.png

13.2 KB
Loading

img/udas-invalid-parameter.png

39.8 KB
Loading

0 commit comments

Comments
 (0)