From 6fed4e9f273a579dbc17f11875241fd5bf3d8734 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sat, 19 Feb 2022 17:10:53 -0500 Subject: add dbstore/sql/feed/insert-assigner.sql --- dbstore/sql/feed/insert-assigner.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 dbstore/sql/feed/insert-assigner.sql (limited to 'dbstore') diff --git a/dbstore/sql/feed/insert-assigner.sql b/dbstore/sql/feed/insert-assigner.sql new file mode 100644 index 0000000..c21f51d --- /dev/null +++ b/dbstore/sql/feed/insert-assigner.sql @@ -0,0 +1,13 @@ +-- add assigner, unless they are already in the database +-- +-- NOTE: might be able to do this more gracefully with an UPSERT in +-- sqlite? +INSERT INTO assigners(assigner) + SELECT :assigner + + EXCEPT + + -- exclude existing assigners + SELECT assigner + FROM assigners + WHERE assigner = :assigner; -- cgit v1.2.3