summaryrefslogtreecommitdiff
path: root/examples/18-database/src
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-10-13 19:43:04 +0100
committerMichael Williamson <mike@zwobble.org>2026-10-13 19:43:04 +0100
commit3afb8859dabdaaa81a6bbbe530d75a4186cc039c (patch)
treea30d6984d3a36158794be1d8c57c7bcd46530964 /examples/18-database/src
parent9cbc19c49933411cdd7e57e7c5de9a04314a387c (diff)
Specify primary key for tables
Diffstat (limited to 'examples/18-database/src')
-rw-r--r--examples/18-database/src/data.hob11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/18-database/src/data.hob b/examples/18-database/src/data.hob
index cad23dd..a168821 100644
--- a/examples/18-database/src/data.hob
+++ b/examples/18-database/src/data.hob
@@ -1,11 +1,12 @@
-struct StructWithInt32 {
- field a: Int32;
- field b: Int32;
+struct Author {
+ field id: Int32;
+ field name: String;
}
databaseSchema Data {
- table structs {
- row StructWithInt32;
+ table authors {
+ row Author;
+ primaryKey id;
}
//
// query fetchAllStructs() {