File tree Expand file tree Collapse file tree
pgt_workspace/src/workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,6 +334,8 @@ mod tests {
334334 assert ! ( valid_pos) ;
335335 assert_eq ! (
336336 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
337339 "select 0 + 0 + 0 + 0 + 0 + NULL "
338340 ) ;
339341 }
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ impl Workspace for WorkspaceServer {
393393 s. args
394394 . iter ( )
395395 . map ( |a| TypedIdentifier {
396- path : s. name . 1 . clone ( ) ,
396+ path : s. name . clone ( ) ,
397397 name : a. name . clone ( ) ,
398398 type_ : IdentifierType {
399399 schema : a. type_ . schema . clone ( ) ,
Original file line number Diff line number Diff line change @@ -8,15 +8,16 @@ pub struct ArgType {
88}
99
1010#[ derive( Debug , Clone ) ]
11- pub struct SQLFunctionArgs {
11+ pub struct SQLFunctionArg {
1212 pub name : Option < String > ,
1313 pub type_ : ArgType ,
1414}
1515
1616#[ derive( Debug , Clone ) ]
1717pub 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 > ,
2021}
2122
2223#[ derive( Debug , Clone ) ]
@@ -50,7 +51,7 @@ pub fn get_sql_fn_signature(ast: &pgt_query_ext::NodeEnum) -> Option<SQLFunction
5051
5152 let arg_type = node. arg_type . as_ref ( ) ?;
5253 let type_name = parse_name ( & arg_type. names ) ?;
53- fn_args. push ( SQLFunctionArgs {
54+ fn_args. push ( SQLFunctionArg {
5455 name : arg_name,
5556 type_ : ArgType {
5657 schema : type_name. 0 ,
@@ -68,7 +69,8 @@ pub fn get_sql_fn_signature(ast: &pgt_query_ext::NodeEnum) -> Option<SQLFunction
6869 }
6970
7071 Some ( SQLFunctionSignature {
71- name : fn_name,
72+ schema : fn_name. 0 ,
73+ name : fn_name. 1 ,
7274 args : fn_args,
7375 } )
7476}
You can’t perform that action at this time.
0 commit comments