Skip to content

Commit

Permalink
update dataspace to contain template query in relational-store showca…
Browse files Browse the repository at this point in the history
…se (#805)
  • Loading branch information
YannanGao-gs authored Apr 9, 2024
1 parent 0dbe92f commit c28091f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions showcases/data/Store/Relational Store/Service/Basic/code.pure
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,48 @@ DataSpace showcase::northwind::dataspace::NorthwindDataSpace
defaultExecutionContext: 'default';
}

DataSpace showcase::northwind::dataspace::NorthwindDataSpaceWithTemplateQuery
{
executionContexts:
[
{
name: 'default';
mapping: showcase::northwind::mapping::NorthwindMapping;
defaultRuntime: showcase::northwind::runtime::NorthwindRuntime;
}
];
defaultExecutionContext: 'default';
executables:
[
{
title: 'this is title - Top Categories';
description: 'this is description - TopCategories';
query: |showcase::northwind::model::Order.all()->groupBy(
[
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.id,
x: showcase::northwind::model::Order[1]|$x.lineItems.product.category.name
],
[
agg(
x: showcase::northwind::model::Order[1]|$x.id,
x: Integer[*]|$x->distinct()->count()
)
],
[
'Category Id',
'Category Name',
'Order Count'
]
)->sort(
[
desc('Order Count')
]
)->take(5);
executionContextKey: 'default';
}
];
}


###Service
Service showcase::northwind::services::graph::OrderDetailsByIdGraphFetch
Expand Down

0 comments on commit c28091f

Please sign in to comment.