File tree 3 files changed +10
-6
lines changed
pgt_workspace/src/workspace
3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,8 @@ mod tests {
334
334
assert ! ( valid_pos) ;
335
335
assert_eq ! (
336
336
sql_out,
337
+ // the numeric parameters are filled with 0;
338
+ // all values of the enums are longer than `NULL`, so we use `NULL` instead
337
339
"select 0 + 0 + 0 + 0 + 0 + NULL "
338
340
) ;
339
341
}
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ impl Workspace for WorkspaceServer {
393
393
s. args
394
394
. iter ( )
395
395
. map ( |a| TypedIdentifier {
396
- path : s. name . 1 . clone ( ) ,
396
+ path : s. name . clone ( ) ,
397
397
name : a. name . clone ( ) ,
398
398
type_ : IdentifierType {
399
399
schema : a. type_ . schema . clone ( ) ,
Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ pub struct ArgType {
8
8
}
9
9
10
10
#[ derive( Debug , Clone ) ]
11
- pub struct SQLFunctionArgs {
11
+ pub struct SQLFunctionArg {
12
12
pub name : Option < String > ,
13
13
pub type_ : ArgType ,
14
14
}
15
15
16
16
#[ derive( Debug , Clone ) ]
17
17
pub struct SQLFunctionSignature {
18
- pub name : ( Option < String > , String ) ,
19
- pub args : Vec < SQLFunctionArgs > ,
18
+ pub schema : Option < String > ,
19
+ pub name : String ,
20
+ pub args : Vec < SQLFunctionArg > ,
20
21
}
21
22
22
23
#[ derive( Debug , Clone ) ]
@@ -50,7 +51,7 @@ pub fn get_sql_fn_signature(ast: &pgt_query_ext::NodeEnum) -> Option<SQLFunction
50
51
51
52
let arg_type = node. arg_type . as_ref ( ) ?;
52
53
let type_name = parse_name ( & arg_type. names ) ?;
53
- fn_args. push ( SQLFunctionArgs {
54
+ fn_args. push ( SQLFunctionArg {
54
55
name : arg_name,
55
56
type_ : ArgType {
56
57
schema : type_name. 0 ,
@@ -68,7 +69,8 @@ pub fn get_sql_fn_signature(ast: &pgt_query_ext::NodeEnum) -> Option<SQLFunction
68
69
}
69
70
70
71
Some ( SQLFunctionSignature {
71
- name : fn_name,
72
+ schema : fn_name. 0 ,
73
+ name : fn_name. 1 ,
72
74
args : fn_args,
73
75
} )
74
76
}
You can’t perform that action at this time.
0 commit comments