Skip to content

Commit

Permalink
include interface in an aggregation (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
DatGuyJonathan committed May 3, 2024
1 parent c2eb720 commit b7bf9a0
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions apps/framework-cli/src/framework/typescript/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,30 +364,40 @@ pub static BASE_AGGREGATION_SAMPLE_TEMPLATE: &str = r#"
// Here is a sample aggregation query that calculates the number of daily active users
// based on the number of unique users who complete a sign-in activity each day.
interface Aggregation {
select: string;
orderBy: string;
}
export default {
select: `
select: `
SELECT
uniqState(userId) as dailyActiveUsers,
toStartOfDay(timestamp) as date
FROM ParsedActivity_0_0
WHERE activity = 'Login'
GROUP BY toStartOfDay(timestamp)
`,
orderBy: 'date',
};
orderBy: "date",
} satisfies Aggregation as Aggregation;
"#;

pub static BASE_AGGREGATION_TEMPLATE: &str = r#"
// This file is where you can define your SQL query for aggregating your data
// from other data models you have defined in Moose. For more information on the
// types of aggregate functions you can run on your existing data, consult the
// This file is where you can define your SQL query for aggregating your data
// from other data models you have defined in Moose. For more information on the
// types of aggregate functions you can run on your existing data, consult the
// Clickhouse documentation: https://clickhouse.com/docs/en/sql-reference/aggregate-functions
interface Aggregation {
select: string;
orderBy: string;
}
export default {
select: ``,
orderBy: '',
};
select: ``,
orderBy: "",
} satisfies Aggregation as Aggregation;
"#;

Expand Down

0 comments on commit b7bf9a0

Please sign in to comment.