diff --git a/bbconf/bb_todo-datamodel.sql b/bbconf/bb_todo-datamodel.sql index 523b8ea..14de577 100644 --- a/bbconf/bb_todo-datamodel.sql +++ b/bbconf/bb_todo-datamodel.sql @@ -1,3 +1,5 @@ +CREATE EXTENSION IF NOT EXISTS pgcrypto; + CREATE TABLE "List" ( "id" UUID DEFAULT gen_random_uuid() NOT NULL, "title" VARCHAR NOT NULL, diff --git a/bbconf/bb_todo-resolver.toml b/bbconf/bb_todo-resolver.toml index f5ca53c..ea10f8c 100644 --- a/bbconf/bb_todo-resolver.toml +++ b/bbconf/bb_todo-resolver.toml @@ -1,3 +1,71 @@ +[resolvers.createTask] +operation_name = "createTask" + +[resolvers.createTask.resolver] +command_type = "SQLInsert" + +[resolvers.createTask.resolver.command] +table = "Task" +columns = [] +where_clauses = [] +aggregate_result = true + +[[resolvers.createTask.resolver.command.modify_values]] +column = "title" +value = "'$title'" + +[[resolvers.createTask.resolver.command.modify_values]] +column = "description" +value = "'$description'" + +[[resolvers.createTask.resolver.command.modify_values]] +column = "completed" +value = "'$completed'" + +[[resolvers.createTask.resolver.command.modify_values]] +column = "list_id" +value = "'$list.$id'" + +[[resolvers.createTask.resolver.command.modify_values]] +column = "user_username" +value = "'$user.$username'" + +[resolvers.getUser] +operation_name = "getUser" + +[resolvers.getUser.resolver] +command_type = "SQLSelect" + +[resolvers.getUser.resolver.command] +table = "User" +columns = [] +modify_values = [] +aggregate_result = true + +[[resolvers.getUser.resolver.command.where_clauses]] +table = "User" +column = "username" +condition_str = "= '$username'" +index = "" + +[resolvers.deleteList] +operation_name = "deleteList" + +[resolvers.deleteList.resolver] +command_type = "SQLDelete" + +[resolvers.deleteList.resolver.command] +table = "List" +columns = [] +modify_values = [] +aggregate_result = true + +[[resolvers.deleteList.resolver.command.where_clauses]] +table = "List" +column = "id" +condition_str = "= '$id'" +index = "" + [resolvers.createList] operation_name = "createList" @@ -18,24 +86,6 @@ value = "'$title'" column = "user_username" value = "'$user.$username'" -[resolvers.deleteTask] -operation_name = "deleteTask" - -[resolvers.deleteTask.resolver] -command_type = "SQLDelete" - -[resolvers.deleteTask.resolver.command] -table = "Task" -columns = [] -modify_values = [] -aggregate_result = true - -[[resolvers.deleteTask.resolver.command.where_clauses]] -table = "Task" -column = "id" -condition_str = "= '$id'" -index = "" - [resolvers.updateTask] operation_name = "updateTask" @@ -69,56 +119,6 @@ column = "id" condition_str = "= '$id'" index = "" -[resolvers.deleteList] -operation_name = "deleteList" - -[resolvers.deleteList.resolver] -command_type = "SQLDelete" - -[resolvers.deleteList.resolver.command] -table = "List" -columns = [] -modify_values = [] -aggregate_result = true - -[[resolvers.deleteList.resolver.command.where_clauses]] -table = "List" -column = "id" -condition_str = "= '$id'" -index = "" - -[resolvers.createTask] -operation_name = "createTask" - -[resolvers.createTask.resolver] -command_type = "SQLInsert" - -[resolvers.createTask.resolver.command] -table = "Task" -columns = [] -where_clauses = [] -aggregate_result = true - -[[resolvers.createTask.resolver.command.modify_values]] -column = "title" -value = "'$title'" - -[[resolvers.createTask.resolver.command.modify_values]] -column = "description" -value = "'$description'" - -[[resolvers.createTask.resolver.command.modify_values]] -column = "completed" -value = "'$completed'" - -[[resolvers.createTask.resolver.command.modify_values]] -column = "list_id" -value = "'$list.$id'" - -[[resolvers.createTask.resolver.command.modify_values]] -column = "user_username" -value = "'$user.$username'" - [resolvers.createUser] operation_name = "createUser" @@ -139,6 +139,24 @@ value = "'$username'" column = "name" value = "'$name'" +[resolvers.deleteTask] +operation_name = "deleteTask" + +[resolvers.deleteTask.resolver] +command_type = "SQLDelete" + +[resolvers.deleteTask.resolver.command] +table = "Task" +columns = [] +modify_values = [] +aggregate_result = true + +[[resolvers.deleteTask.resolver.command.where_clauses]] +table = "Task" +column = "id" +condition_str = "= '$id'" +index = "" + [resolvers.updateList] operation_name = "updateList" @@ -159,21 +177,3 @@ table = "List" column = "id" condition_str = "= '$id'" index = "" - -[resolvers.getUser] -operation_name = "getUser" - -[resolvers.getUser.resolver] -command_type = "SQLSelect" - -[resolvers.getUser.resolver.command] -table = "User" -columns = [] -modify_values = [] -aggregate_result = true - -[[resolvers.getUser.resolver.command.where_clauses]] -table = "User" -column = "username" -condition_str = "= '$username'" -index = ""