summaryrefslogtreecommitdiff
path: root/examples/18-database/src/data.hob
blob: 927f4f17feae0565addc91357a74e2af353a0db2 (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 == 42);
//}

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