summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-01-08 19:36:01 +0100
committerxengineering <me@xengineering.eu>2024-01-08 19:36:01 +0100
commitae1a31f226de5701683231afaabf0f66503ca17d (patch)
treeb11a8b8c91ac41ee7ffb783de23b5c38dd9e2e6a /model
parent43e7bb10eaade56a9444ec089aa3102218231868 (diff)
downloadceres-ae1a31f226de5701683231afaabf0f66503ca17d.tar
ceres-ae1a31f226de5701683231afaabf0f66503ca17d.tar.zst
ceres-ae1a31f226de5701683231afaabf0f66503ca17d.zip
Implement recipe editing
Diffstat (limited to 'model')
-rw-r--r--model/data.go4
-rw-r--r--model/sql/recipe-update.sql7
2 files changed, 11 insertions, 0 deletions
diff --git a/model/data.go b/model/data.go
index b5edd85..3e0e73d 100644
--- a/model/data.go
+++ b/model/data.go
@@ -3,3 +3,7 @@ package model
type ReadableData interface {
FromDB() error
}
+
+type WritableData interface {
+ ToDB() error
+}
diff --git a/model/sql/recipe-update.sql b/model/sql/recipe-update.sql
new file mode 100644
index 0000000..fbc03fa
--- /dev/null
+++ b/model/sql/recipe-update.sql
@@ -0,0 +1,7 @@
+UPDATE recipes
+SET
+ title = ?,
+ portions = ?,
+ url = ?,
+ notes = ?
+WHERE id = ?;