Markus is a query language created in 2020.
#2695on PLDB | 4Years Old |
git clone https://github.com/Markus-Studio/Markus
A declarative (database) query language!
type User: user {
name: string;
}
type Task {
owner: User;
title: string;
done: bool;
}
query myTasks() {
is(Task),
# %user is the current authenticated user.
eq(.owner, %user)
}
action newTask($title: string) {
create Task {
user: %user,
title: $title,
done: false
};
}
action toggleStatus($task: Task) {
validate eq($task.owner, %user);
update $task {
.done: not(.done)
};
}
action delete($task: Task) {
validate eq($task.owner, %user);
delete $task;
}
action edit($task: Task, $new_title: string) {
validate eq($task.owner, %user);
update $task {
.title: $new_title
};
}