-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mapping of aggregate functions in v3->v2 query translation (#26)
- Loading branch information
1 parent
5c64d7d
commit bb1a45f
Showing
8 changed files
with
176 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# this line sources your `.envrc.local` file | ||
source_env_if_exists .envrc.local | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#[macro_export()] | ||
macro_rules! column_aggregate { | ||
($name:literal => $column:literal, $function:literal : $typ:literal) => { | ||
( | ||
$name.to_owned(), | ||
dc_api_types::Aggregate::SingleColumn { | ||
column: $column.to_owned(), | ||
function: $function.to_owned(), | ||
result_type: $typ.to_owned(), | ||
}, | ||
) | ||
}; | ||
} | ||
|
||
#[macro_export()] | ||
macro_rules! star_count_aggregate { | ||
($name:literal) => { | ||
( | ||
$name.to_owned(), | ||
dc_api_types::Aggregate::StarCount {}, | ||
) | ||
}; | ||
} | ||
|
||
#[macro_export()] | ||
macro_rules! column_count_aggregate { | ||
($name:literal => $column:literal, distinct:$distinct:literal) => { | ||
( | ||
$name.to_owned(), | ||
dc_api_types::Aggregate::ColumnCount { | ||
column: $column.to_owned(), | ||
distinct: $distinct.to_owned(), | ||
}, | ||
) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#[macro_export()] | ||
macro_rules! column_aggregate { | ||
($name:literal => $column:literal, $function:literal) => { | ||
( | ||
$name, | ||
ndc_sdk::models::Aggregate::SingleColumn { | ||
column: $column.to_owned(), | ||
function: $function.to_owned() | ||
}, | ||
) | ||
}; | ||
} | ||
|
||
#[macro_export()] | ||
macro_rules! star_count_aggregate { | ||
($name:literal) => { | ||
( | ||
$name, | ||
ndc_sdk::models::Aggregate::StarCount {}, | ||
) | ||
}; | ||
} | ||
|
||
#[macro_export()] | ||
macro_rules! column_count_aggregate { | ||
($name:literal => $column:literal, distinct:$distinct:literal) => { | ||
( | ||
$name, | ||
ndc_sdk::models::Aggregate::ColumnCount { | ||
column: $column.to_owned(), | ||
distinct: $distinct.to_owned(), | ||
}, | ||
) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters