From 54d54f3b75b512ae75869e3d6e724f694887f7be Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Thu, 5 Jan 2023 11:50:58 -0800 Subject: [PATCH] this is shit nvm --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..627c593 --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +# DSL Idea + +## How should it look? + +```bash +# User class +# auto-handles `id`, `pwhash`, and 2FA +schema User auth + id int primary index + name string required + bio string required + email email required + created tzdate once`datetime.datetime.now()` + + +# foreign key relations are specified with `@` +schema Friendship + id int primary index + u1_id int @user.id required + u2_id int @user.id required + + +# specify returned fields in brackets [field1 field2] +endpoint /user/{uid} + find User (id == uid) [name bio created] + + +# * this is a auth-protected endpoint +# * the `|` operator evaluates the next statement if the current one fails +endpoint /friends auth + find Friendship (u1id == auth.id or u2id == auth.id) one [u1id u2id] >> + find User (id == u1id) one [name bio] + | find User (id == u2id) one [name bio] +``` +