Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include interface in an aggregation #1160

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,29 +364,39 @@ 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;

"#;