-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
153ebef
commit 70a5175
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CREATE OR REPLACE FUNCTION get_bulk_results(id_param INT) | ||
RETURNS TABLE( | ||
id integer, | ||
email text, | ||
is_reachable is_reachable_type, | ||
result json, | ||
verified_at timestamptz | ||
) AS $$ | ||
BEGIN | ||
RETURN QUERY | ||
SELECT | ||
c.bulk_email_id as id, | ||
b.email, | ||
c.is_reachable, | ||
c.result, | ||
c.created_at as verified_at | ||
FROM | ||
calls c | ||
INNER JOIN | ||
bulk_emails b ON c.bulk_email_id = b.id | ||
WHERE | ||
b.bulk_job_id = id_param; | ||
END; | ||
$$ LANGUAGE plpgsql; |