summaryrefslogtreecommitdiff
path: root/examples/18-database/src/data.hob
blob: 9c813c37c055dc2d541064ef8c7e7577c51c1e5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
struct Author {
    field id: Int32;
    field name: String;
}

databaseSchema Data {
    table authors {
        row Author;
        primaryKey id;
    }
}

query allAuthors() {
    return Data.authors;
}

query authorsByFixedId() {
    return Data.authors.where($(author) => author.id == 2);
}

//query authorsByName(name: String) {
//    return Data.authors
//        .where($(author) => author.name == name);
//}