From 07bb457dfa10d73e0812d34a2831f542b4cc4391 Mon Sep 17 00:00:00 2001 From: Ivan Grishaev Date: Tue, 6 Feb 2018 17:09:08 +0300 Subject: [PATCH] 193 user exists query added --- resources/sql/queries.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/sql/queries.sql b/resources/sql/queries.sql index 9d9acf2..082c636 100644 --- a/resources/sql/queries.sql +++ b/resources/sql/queries.sql @@ -17,6 +17,12 @@ WHERE NOT exists(SELECT 1 WHERE id = :id) RETURNING id, login, name, email, avatar_url, address, created; +-- :name user-exists? :? :1 +-- :doc Checks where a user exists in the database. +select 1 +from users u +where u.id = :id; + -- :name update-user! :! :n -- :doc updates an existing user record UPDATE users