You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATETABLEstudent (
-- https://blog.ploeh.dk/2024/06/03/youll-regret-using-natural-keys/
id INTEGERPRIMARY KEY,
student_id TEXTNOT NULL,
semester SEMESTER_TEXT NOT NULL,
UNIQUE(student_id, semester)
);
CREATETABLEhomework (
id INTEGERPRIMARY KEY,
name TEXTNOT NULL,
semester SEMESTER_TEXT NOT NULL,
begin_at DATETIME_TEXT NOT NULL,
end_at DATETIME_TEXT NOT NULL,
UNIQUE(name, semester)
);
CREATETABLEgrade (
id INTEGERPRIMARY KEY,
student_id INTEGERNOT NULL,
homework_id INTEGERNOT NULL,
submitted_at DATETIME_TEXT NOT NULL,
grade REALNOT NULL,
FOREIGN KEY (student_id) REFERENCES student (id) ON DELETE CASCADE,
FOREIGN KEY (homework_id) REFERENCES homework (id) ON DELETE CASCADE
);
SQL queries
SELECTstudent.student_id,
CAST(max(grade.grade) ASREAL) AS grade
FROM homework
CROSS JOIN student
LEFT JOIN grade ONhomework.id=grade.homework_idANDstudent.id=grade.student_idWHEREhomework.semester= ? ANDhomework.name= ?
GROUP BYstudent.idORDER BYstudent.student_idASC;
Version
1.27.0
What happened?
According to SQlite docs
But using
CAST
in sqlc doesn't generate nullable typesExpected:
Actual:
Relevant log output
No response
Database schema
SQL queries
Configuration
Playground URL
No response
What operating system are you using?
Linux
What database engines are you using?
SQLite
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: