aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2025-02-19 17:05:38 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2025-02-19 19:26:12 +0100
commit50dab0c091e5e807e1ddd5bcbe669d9840759c7e (patch)
tree23a4779d8d21bba233b0168167683acd67f28451 /docs
parentc36c4cf37737ba972482a34c8df2b61a541e7f0a (diff)
add `docs/tutorial-achat.md`
Diffstat (limited to 'docs')
-rw-r--r--docs/tutorial-achat.md100
1 files changed, 100 insertions, 0 deletions
diff --git a/docs/tutorial-achat.md b/docs/tutorial-achat.md
new file mode 100644
index 0000000..82a2bcf
--- /dev/null
+++ b/docs/tutorial-achat.md
@@ -0,0 +1,100 @@
+## authentication
+
+TODO
+
+## create user
+
+```console
+acms collection add user <<'EOF'
+{
+ "username": "joe"
+}
+EOF
+```
+
+```json
+{
+ "$id": "9474f0eb-06d7-4fd8-b89e-0ce996962508",
+ "username": "joe"
+}
+```
+
+## create chat
+
+```console
+acms collection add chat <<'EOF'
+{
+ "title": "how does acms work?"
+}
+EOF
+```
+
+## list chats
+
+```console
+acms collection list chat
+```
+
+```json
+{
+ "$id": "ccccc18c-f3dc-4f98-b4d2-290ef76adb6b",
+ "title": "how does acms work?"
+}
+```
+
+## create chat message
+
+```console
+acms collection add chat-message <<'EOF'
+{
+ "chat": {
+ "$ref": "chat/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b"
+ },
+ "message": "please see the [docs]()",
+ "user": {
+ "$ref": "user/9474f0eb-06d7-4fd8-b89e-0ce996962508"
+ }
+}
+EOF
+```
+
+```json
+{
+ "$id": "6dc0bf04-b453-4396-9efc-0b8b8f338d9c",
+ "chat": {
+ "$ref": "chat/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b"
+ },
+ "message": "please see the [docs]()",
+ "user": {
+ "$ref": "user/9474f0eb-06d7-4fd8-b89e-0ce996962508"
+ }
+}
+```
+
+## list chat messages
+
+```console
+acms query <<'EOF'
+SELECT
+ chat-message
+FROM
+ chat-message
+WHERE
+ chat-message.chat.$ref == "chat/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b"
+EOF
+```
+
+```json
+[
+ {
+ "$id": "6dc0bf04-b453-4396-9efc-0b8b8f338d9c",
+ "chat": {
+ "$ref": "chat/ccccc18c-f3dc-4f98-b4d2-290ef76adb6b"
+ },
+ "message": "please see the [docs]()",
+ "user": {
+ "$ref": "user/9474f0eb-06d7-4fd8-b89e-0ce996962508"
+ }
+ }
+]
+```