Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
648bd49
initial select syntax diagram
Akatuoro Feb 4, 2026
50c5112
Merge remote-tracking branch 'origin/main' into cql
Akatuoro Feb 9, 2026
cb72a74
select item and projection diagrams
Akatuoro Feb 9, 2026
571917b
new diagram style
Akatuoro Feb 10, 2026
4a19e39
adjustments
Akatuoro Feb 10, 2026
1525ad3
inline svg
Akatuoro Feb 10, 2026
7b6b0d1
query source
Akatuoro Feb 10, 2026
ccfb388
adjustments
Akatuoro Feb 10, 2026
5ae6b56
ordering term
Akatuoro Feb 10, 2026
3191977
improve diagram css
Akatuoro Feb 10, 2026
bcd02b1
md plugin for raw svg import
Akatuoro Feb 10, 2026
cdaed27
continue working on examples
patricebender Feb 16, 2026
3fb067c
add wildcard to select item, correct example
patricebender Feb 23, 2026
7a11303
Merge remote-tracking branch 'origin/main' into cql
patricebender Feb 23, 2026
cba0cc1
more samples
patricebender Feb 23, 2026
0f293a4
expand and inline
patricebender Feb 23, 2026
ebc498e
more samples
patricebender Feb 23, 2026
3028af2
Merge remote-tracking branch 'origin/main' into cql
Akatuoro Mar 2, 2026
1794ff0
document expands, inlines + more samples
Akatuoro Mar 2, 2026
39ea798
add links
Akatuoro Mar 2, 2026
c076d96
sketch where, group by, having and order by
patricebender Mar 3, 2026
d3c43c7
move enums down
patricebender Mar 3, 2026
88fdd8a
limit + offset
patricebender Mar 3, 2026
574e97d
links
patricebender Mar 3, 2026
66ae8c1
some additions for the review
patricebender Mar 4, 2026
a584e0c
review additions
patricebender Mar 6, 2026
793426e
sketch enum section
patricebender Mar 6, 2026
3ff4a87
update entry section
patricebender Mar 6, 2026
d19e27b
Merge branch 'main' into cql
patricebender Mar 27, 2026
ca228b6
apply review
Akatuoro Apr 17, 2026
7a0ea72
add enum samples and model extension
patricebender Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .vitepress/lib/cds-playground/templates/bookshop/db/address.cds
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace sap.capire.bookshop;

entity Addresses {
key ID : Integer;
city : Association to Cities;
street : String;
}

entity Cities {
key ID : Integer;
name : String;
country : String;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ID,city_ID,street
1,1,Parsonage Lane
2,2,Carver Street
3,3,Church Street
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ID,name,dateOfBirth,placeOfBirth,dateOfDeath,placeOfDeath
101,Emily Brontë,1818-07-30,"Thornton, Yorkshire",1848-12-19,"Haworth, Yorkshire"
107,Charlotte Brontë,1818-04-21,"Thornton, Yorkshire",1855-03-31,"Haworth, Yorkshire"
150,Edgar Allen Poe,1809-01-19,"Boston, Massachusetts",1849-10-07,"Baltimore, Maryland"
170,Richard Carpenter,1929-08-14,"King’s Lynn, Norfolk",2012-02-26,"Hertfordshire, England"
ID,name,dateOfBirth,placeOfBirth,dateOfDeath,placeOfDeath,address_ID
101,Emily Brontë,1818-07-30,"Thornton, Yorkshire",1848-12-19,"Haworth, Yorkshire",1
107,Charlotte Brontë,1818-04-21,"Thornton, Yorkshire",1855-03-31,"Haworth, Yorkshire",1
150,Edgar Allen Poe,1809-01-19,"Boston, Massachusetts",1849-10-07,"Baltimore, Maryland",2
170,Richard Carpenter,1929-08-14,"King’s Lynn, Norfolk",2012-02-26,"Hertfordshire, England",3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ID,title,descr,author_ID,stock,price,currency_code,genre_ID
201,Wuthering Heights,"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.",101,12,11.11,GBP,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
207,Jane Eyre,"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.",107,11,12.34,GBP,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
251,The Raven,"""The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.",150,333,13.13,USD,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
252,Eleonora,"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.",150,555,14,USD,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
271,Catweazle,"Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.",170,22,150,JPY,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
ID,title,descr,author_ID,stock,price,currency_code,genre_ID,status
201,Wuthering Heights,"Wuthering Heights, Emily Brontë's only novel, was published in 1847 under the pseudonym ""Ellis Bell"". It was written between October 1845 and June 1846. Wuthering Heights and Anne Brontë's Agnes Grey were accepted by publisher Thomas Newby before the success of their sister Charlotte's novel Jane Eyre. After Emily's death, Charlotte edited the manuscript of Wuthering Heights and arranged for the edited version to be published as a posthumous second edition in 1850.",101,12,11.11,GBP,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,P
207,Jane Eyre,"Jane Eyre /ɛər/ (originally published as Jane Eyre: An Autobiography) is a novel by English writer Charlotte Brontë, published under the pen name ""Currer Bell"", on 16 October 1847, by Smith, Elder & Co. of London. The first American edition was published the following year by Harper & Brothers of New York. Primarily a bildungsroman, Jane Eyre follows the experiences of its eponymous heroine, including her growth to adulthood and her love for Mr. Rochester, the brooding master of Thornfield Hall. The novel revolutionised prose fiction in that the focus on Jane's moral and spiritual development is told through an intimate, first-person narrative, where actions and events are coloured by a psychological intensity. The book contains elements of social criticism, with a strong sense of Christian morality at its core and is considered by many to be ahead of its time because of Jane's individualistic character and how the novel approaches the topics of class, sexuality, religion and feminism.",107,11,12.34,GBP,11aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,P
251,The Raven,"""The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.",150,333,13.13,USD,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,P
252,Eleonora,"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.",150,555,14,USD,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,D
271,Catweazle,"Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.",170,22,150,JPY,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa,PS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ID,name,country
1,Haworth,United Kingdom
2,Boston,United States
3,King's Lynn,United Kingdom
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// enhance bookshop with more stuff

using { sap.capire.bookshop as my } from './schema';


extend my.Books with {
status : Status;
}

type Status: String enum {
presale = 'PS';
published = 'P';
discontinued = 'D';
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using { sap.capire.bookshop.Addresses } from './address';
using { Currency, cuid, managed, sap } from '@sap/cds/common';
namespace sap.capire.bookshop;

entity Books {
entity Books : managed {
key ID : Integer;
author : Association to Authors @mandatory;
title : localized String @mandatory;
Expand All @@ -14,14 +15,15 @@ entity Books {
total = price * stock;
}

entity Authors {
entity Authors : managed {
key ID : Integer;
name : String @mandatory;
dateOfBirth : Date;
dateOfDeath : Date;
placeOfBirth : String;
placeOfDeath : String;
books : Association to many Books on books.author = $self;
address : Association to Addresses;

cheapBooks = books[price < 19.99]; // based on `books` association
age = years_between(dateOfBirth, coalesce(dateOfDeath, date( $now )));
Expand Down
Loading
Loading