aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-19 17:10:53 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-19 17:10:53 -0500
commit6fed4e9f273a579dbc17f11875241fd5bf3d8734 (patch)
tree1f4b3363c9c46ca45b634073eea21a9b965ff2e5
parent19cbd7952f8f70cfe030a1a894aaff16af8ec8fe (diff)
downloadcvez-6fed4e9f273a579dbc17f11875241fd5bf3d8734.tar.bz2
cvez-6fed4e9f273a579dbc17f11875241fd5bf3d8734.zip
add dbstore/sql/feed/insert-assigner.sql
-rw-r--r--dbstore/sql/feed/insert-assigner.sql13
1 files changed, 13 insertions, 0 deletions
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;