summaryrefslogtreecommitdiff
path: root/internal/database/repos
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-04-05 15:04:15 +0300
committerGrail Finder <wohilas@gmail.com>2025-04-05 15:04:15 +0300
commit8bc7544e8933d64abc2610a265f37fe13b5767d5 (patch)
treeddcb10ff89723d0c490f6c1e781928ae89666b25 /internal/database/repos
parent287da7acfa71ff07c52035a437209022b4ddc5d6 (diff)
Feat: question repo
Diffstat (limited to 'internal/database/repos')
-rw-r--r--internal/database/repos/questions.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/internal/database/repos/questions.go b/internal/database/repos/questions.go
new file mode 100644
index 0000000..d9978a4
--- /dev/null
+++ b/internal/database/repos/questions.go
@@ -0,0 +1,16 @@
+package repos
+
+import "demoon/internal/models"
+
+type QuestionsRepo interface {
+ DBGetQuestion(id string) (*models.Question, error)
+}
+
+func (p *Provider) DBGetQuestion(id string) (*models.Question, error) {
+ var question models.Question
+ err := p.db.Get(&question, "SELECT * FROM questions WHERE id = ?", id)
+ if err != nil {
+ return nil, err
+ }
+ return &question, nil
+}