diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-07 23:22:07 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-08 04:02:37 +0900 |
| commit | 47d81ffbd3e4fe178d2935325e312cef77276250 (patch) | |
| tree | 341f7aaa3429dbecc60cbfad0a84e6846152814e /backend/db/query.sql.go | |
| parent | 14f48b4e4f7463e0972c2a5b39e94ee674ec93ba (diff) | |
| download | phperkaigi-2025-albatross-47d81ffbd3e4fe178d2935325e312cef77276250.tar.gz phperkaigi-2025-albatross-47d81ffbd3e4fe178d2935325e312cef77276250.tar.zst phperkaigi-2025-albatross-47d81ffbd3e4fe178d2935325e312cef77276250.zip | |
feat(backend): create submission_results table
Diffstat (limited to 'backend/db/query.sql.go')
| -rw-r--r-- | backend/db/query.sql.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go index 6c78267..cfb97fd 100644 --- a/backend/db/query.sql.go +++ b/backend/db/query.sql.go @@ -36,6 +36,28 @@ func (q *Queries) CreateSubmission(ctx context.Context, arg CreateSubmissionPara return submission_id, err } +const createSubmissionResult = `-- name: CreateSubmissionResult :exec +INSERT INTO submission_results (submission_id, status, stdout, stderr) +VALUES ($1, $2, $3, $4) +` + +type CreateSubmissionResultParams struct { + SubmissionID int32 + Status string + Stdout string + Stderr string +} + +func (q *Queries) CreateSubmissionResult(ctx context.Context, arg CreateSubmissionResultParams) error { + _, err := q.db.Exec(ctx, createSubmissionResult, + arg.SubmissionID, + arg.Status, + arg.Stdout, + arg.Stderr, + ) + return err +} + const createTestcaseResult = `-- name: CreateTestcaseResult :exec INSERT INTO testcase_results (submission_id, testcase_id, status, stdout, stderr) VALUES ($1, $2, $3, $4, $5) |
