mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: sql plugins feature
This commit is contained in:
parent
920bd1e88d
commit
035862bade
@ -7760,28 +7760,11 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||
],
|
||||
"public/app/plugins/datasource/mssql/query_ctrl.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"]
|
||||
],
|
||||
"public/app/plugins/datasource/mssql/response_parser.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||
],
|
||||
"public/app/plugins/datasource/mssql/specs/datasource.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "2"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "3"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "4"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "6"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "7"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "8"]
|
||||
],
|
||||
"public/app/plugins/datasource/mssql/types.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"],
|
||||
|
@ -90,6 +90,7 @@
|
||||
"@babel/preset-env": "7.18.2",
|
||||
"@babel/preset-react": "7.18.6",
|
||||
"@babel/preset-typescript": "7.18.6",
|
||||
"@babel/runtime": "7.18.6",
|
||||
"@betterer/betterer": "5.3.5",
|
||||
"@betterer/cli": "5.3.5",
|
||||
"@betterer/eslint": "5.3.5",
|
||||
@ -390,6 +391,7 @@
|
||||
"semver": "7.3.7",
|
||||
"slate": "0.47.8",
|
||||
"slate-plain-serializer": "0.7.10",
|
||||
"sql-formatter-plus": "^1.3.6",
|
||||
"symbol-observable": "4.0.0",
|
||||
"test": "link:./public/test",
|
||||
"tether-drop": "https://github.com/torkelo/drop",
|
||||
|
@ -119,7 +119,7 @@ export interface DB {
|
||||
tables: (dataset?: string) => Promise<string[]>;
|
||||
fields: (query: SQLQuery, order?: boolean) => Promise<SQLSelectableValue[]>;
|
||||
validateQuery: (query: SQLQuery, range?: TimeRange) => Promise<ValidationResults>;
|
||||
dsID: () => string;
|
||||
dsID: () => number;
|
||||
dispose?: (dsID?: string) => void;
|
||||
lookup: (path?: string) => Promise<Array<{ name: string; completion: string }>>;
|
||||
getSqlCompletionProvider: () => LanguageCompletionProvider;
|
||||
@ -135,7 +135,7 @@ export interface QueryEditorProps {
|
||||
|
||||
export interface ValidationResults {
|
||||
query: SQLQuery;
|
||||
rawSql: string;
|
||||
rawSql?: string;
|
||||
error: string;
|
||||
isError: boolean;
|
||||
isValid: boolean;
|
||||
|
@ -14,7 +14,7 @@ export function useSqlChange({ query, onQueryChange, db }: UseSqlChange) {
|
||||
const onSqlChange = useCallback(
|
||||
(sql: SQLExpression) => {
|
||||
const toRawSql = db.toRawSql || defaultToRawSql;
|
||||
const rawSql = toRawSql({ sql, dataset: query.dataset, table: query.table, refId: db.dsID() });
|
||||
const rawSql = toRawSql({ sql, dataset: query.dataset, table: query.table, refId: query.refId });
|
||||
const newQuery: SQLQuery = { ...query, sql, rawSql };
|
||||
onQueryChange(newQuery);
|
||||
},
|
||||
|
33
yarn.lock
33
yarn.lock
@ -3177,6 +3177,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/polyfill@npm:^7.6.0":
|
||||
version: 7.12.1
|
||||
resolution: "@babel/polyfill@npm:7.12.1"
|
||||
dependencies:
|
||||
core-js: ^2.6.5
|
||||
regenerator-runtime: ^0.13.4
|
||||
checksum: 3f59a9d85a41b390b044a1be13e11ae6d8efbfcf4e07217964585c7cef337b828eecfc5e164083227189146d2b6efc1affae8f59c831438eb40b848ab6fe5f39
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/preset-env@npm:7.18.2":
|
||||
version: 7.18.2
|
||||
resolution: "@babel/preset-env@npm:7.18.2"
|
||||
@ -3447,6 +3457,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/runtime@npm:7.18.6":
|
||||
version: 7.18.6
|
||||
resolution: "@babel/runtime@npm:7.18.6"
|
||||
dependencies:
|
||||
regenerator-runtime: ^0.13.4
|
||||
checksum: 8b707b64ae0524db617d0c49933b258b96376a38307dc0be8fb42db5697608bcc1eba459acce541e376cff5ed5c5287d24db5780bd776b7c75ba2c2e26ff8a2c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.1, @babel/runtime@npm:^7.11.1, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.1, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2":
|
||||
version: 7.15.4
|
||||
resolution: "@babel/runtime@npm:7.15.4"
|
||||
@ -16364,7 +16383,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"core-js@npm:^2.0.0, core-js@npm:^2.4.0":
|
||||
"core-js@npm:^2.0.0, core-js@npm:^2.4.0, core-js@npm:^2.6.5":
|
||||
version: 2.6.12
|
||||
resolution: "core-js@npm:2.6.12"
|
||||
checksum: 44fa9934a85f8c78d61e0c8b7b22436330471ffe59ec5076fe7f324d6e8cf7f824b14b1c81ca73608b13bdb0fef035bd820989bf059767ad6fa13123bb8bd016
|
||||
@ -21079,6 +21098,7 @@ __metadata:
|
||||
"@babel/preset-env": 7.18.2
|
||||
"@babel/preset-react": 7.18.6
|
||||
"@babel/preset-typescript": 7.18.6
|
||||
"@babel/runtime": 7.18.6
|
||||
"@betterer/betterer": 5.3.5
|
||||
"@betterer/cli": 5.3.5
|
||||
"@betterer/eslint": 5.3.5
|
||||
@ -21360,6 +21380,7 @@ __metadata:
|
||||
sinon: 14.0.0
|
||||
slate: 0.47.8
|
||||
slate-plain-serializer: 0.7.10
|
||||
sql-formatter-plus: ^1.3.6
|
||||
style-loader: 3.3.1
|
||||
stylelint: 14.9.1
|
||||
stylelint-config-prettier: 9.0.3
|
||||
@ -34208,6 +34229,16 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"sql-formatter-plus@npm:^1.3.6":
|
||||
version: 1.3.6
|
||||
resolution: "sql-formatter-plus@npm:1.3.6"
|
||||
dependencies:
|
||||
"@babel/polyfill": ^7.6.0
|
||||
lodash: ^4.17.15
|
||||
checksum: 5c215f85936b3465d6778af868f0a8a2d3dd4b714ab95025c3b17b9748fe420ae2e128c523d50be0a43667bf8329a974f3248828971299146786e28d9714e752
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"sqlstring@npm:^2.3.2":
|
||||
version: 2.3.3
|
||||
resolution: "sqlstring@npm:2.3.3"
|
||||
|
Loading…
Reference in New Issue
Block a user