@@ -11,20 +11,20 @@ export type QueryFailureError = {
11
11
} ;
12
12
13
13
interface IQueryBySQL {
14
- title : string ;
14
+ name : string ;
15
15
query : { type : DataSourceType ; key : string ; sql : string ; pre_process : string ; post_process : string } ;
16
16
payload : TPayloadForSQL ;
17
17
}
18
18
19
- export async function queryBySQL ( { query, payload } : IQueryBySQL , signal : AbortSignal ) {
19
+ export async function queryBySQL ( { query, name , payload } : IQueryBySQL , signal : AbortSignal ) {
20
20
if ( ! query . sql ) {
21
21
return [ ] ;
22
22
}
23
23
const { type, key, sql, pre_process, post_process } = query ;
24
24
25
25
const formattedSQL = formatSQL ( sql , payload ) ;
26
26
const finalSQL = preProcessSQLQuery ( { sql : formattedSQL , pre_process } ) ;
27
- let data = await APIClient . query ( signal ) ( { type, key, query : finalSQL } , { } ) ;
27
+ let data = await APIClient . query ( signal ) ( { type, key, query : finalSQL } , { params : { name } } ) ;
28
28
data = postProcessSQLQuery ( post_process , data ) ;
29
29
return data ;
30
30
}
@@ -33,10 +33,11 @@ interface IQueryByHTTP {
33
33
type : DataSourceType ;
34
34
key : string ;
35
35
configString : string ;
36
+ name : string ;
36
37
}
37
38
38
- export async function queryByHTTP ( { type, key, configString } : IQueryByHTTP , signal : AbortSignal ) {
39
- const res = await APIClient . query ( signal ) ( { type, key, query : configString } , { } ) ;
39
+ export async function queryByHTTP ( { type, key, configString, name } : IQueryByHTTP , signal : AbortSignal ) {
40
+ const res = await APIClient . query ( signal ) ( { type, key, query : configString } , { params : { name } } ) ;
40
41
return res ;
41
42
}
42
43
0 commit comments