sqlc-dev / sqlc-gen-typescript

289 stars 12 forks source link

Support for sqlc.embed #42

Open masar3141 opened 2 days ago

masar3141 commented 2 days ago

As per the doc;

-- name: ScoreAndTests :many
SELECT sqlc.embed(students), sqlc.embed(test_scores)
FROM students
JOIN test_scores ON test_scores.student_id = students.id
WHERE students.id = $1;

produce this interface:

export interface ScoreAndTestsRow {
    students: string | null;
    testScores: string | null;
}

where we would expect

export interface ScoreAndTestsRow {
    students: Student;
    testScores: TestScore;
}