Skip to content

Commit 324fc87

Browse files
committed
fix: review
1 parent 8c4145a commit 324fc87

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

crates/pgt_typecheck/src/typed_identifier.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

crates/pgt_workspace/src/workspace/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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(),

crates/pgt_workspace/src/workspace/server/sql_function.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff 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)]
1717
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>,
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
}

0 commit comments

Comments
 (0)