added GetUser function

This commit is contained in:
Miloš Jovanović 2026-09-09 23:15:09 +02:00
parent 6df7c52e9e
commit b665bf63a0
5 changed files with 112 additions and 6 deletions

View file

@ -4,6 +4,7 @@ import (
"database/sql"
"errors"
"modernc.org/sqlite"
sqlite3 "modernc.org/sqlite/lib"
)
@ -42,7 +43,7 @@ func (s *SQLStore) AcquireLock(chapterID int64, dept string, repID int64) (int64
`INSERT INTO runs (chapter_id, department, rep_user_id, status)
VALUES (?, ?, ?, 'running')`, chapterID, dept, repID)
if err != nil {
var serr *sqLite.Error
var serr *sqlite.Error
if errors.As(err, &serr) && serr.Code() == sqlite3.SQLITE_CONSTRAINT_UNIQUE {
return 0, ErrLocked
}