From dc55f9c0097e1c36b85d7666071b840b902920e9 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Mon, 20 Jan 2025 02:56:25 +0000
Subject: Add calendar support

---
 pkg/database/query/calendars.sql | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 pkg/database/query/calendars.sql

(limited to 'pkg/database/query/calendars.sql')

diff --git a/pkg/database/query/calendars.sql b/pkg/database/query/calendars.sql
new file mode 100644
index 0000000..490475d
--- /dev/null
+++ b/pkg/database/query/calendars.sql
@@ -0,0 +1,23 @@
+-- name: CreateCalendar :one
+INSERT INTO calendars (
+  user_id, name, key
+) VALUES (
+  $1, $2, $3
+)
+RETURNING *;
+
+-- name: GetCalendarForUser :one
+SELECT * FROM calendars
+WHERE user_id = $1 LIMIT 1;
+
+-- name: GetCalendarByName :one
+SELECT * FROM calendars
+WHERE name = $1 LIMIT 1;
+
+-- name: DeleteCalendar :execrows
+DELETE FROM calendars
+WHERE user_id = $1;
+
+-- name: DeleteCalendarByName :execrows
+DELETE FROM calendars
+WHERE name = $1;
-- 
cgit v1.2.3-70-g09d2

